Files
DroidScope/backend-go/protocol/events.go
T
achmad 6a53f87e03 chore: initial project scaffold
Sets up monorepo with Wails desktop shell, Go backend, React/TS frontend, and Kotlin Android SDK skeleton.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 13:13:21 +07:00

58 lines
1.6 KiB
Go

package protocol
const ProtocolVersion = "1.0"
type Event struct {
Type string `json:"type"`
Timestamp int64 `json:"timestamp"`
DeviceID string `json:"deviceId"`
SessionID string `json:"sessionId"`
Payload interface{} `json:"payload"`
}
const (
EventLogcat = "logcat"
EventNetworkRequest = "network.request"
EventNetworkResponse = "network.response"
EventPrefsUpdate = "prefs.update"
EventFileList = "file.list"
EventDeviceInfo = "device.info"
)
type LogcatPayload struct {
Tag string `json:"tag"`
Priority string `json:"priority"`
Message string `json:"message"`
PID int `json:"pid"`
}
type NetworkRequestPayload struct {
RequestID string `json:"requestId"`
URL string `json:"url"`
Method string `json:"method"`
Headers map[string]string `json:"headers"`
Body string `json:"body,omitempty"`
}
type NetworkResponsePayload struct {
RequestID string `json:"requestId"`
StatusCode int `json:"statusCode"`
Headers map[string]string `json:"headers"`
Body string `json:"body,omitempty"`
Size int64 `json:"size"`
DurationMs int64 `json:"durationMs"`
}
type PrefsUpdatePayload struct {
File string `json:"file"`
Prefs map[string]string `json:"prefs"`
}
type DeviceInfoPayload struct {
Manufacturer string `json:"manufacturer"`
Model string `json:"model"`
AndroidVersion string `json:"androidVersion"`
ABI string `json:"abi"`
RAM int64 `json:"ram"`
}