-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmsg.go
79 lines (68 loc) · 2.21 KB
/
msg.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package main
import "github.com/creativenucleus/bytejammer/machines"
type DataLog struct {
Msg string
}
type MsgTicState struct {
Code []byte
IsRunning bool
CursorX int
CursorY int
}
type DataIdentity struct {
Uuid string `json:"uuid"`
DisplayName string `json:"displayName"`
PublicKey []byte `json:"publicKey"`
}
type DataCloseMachine struct {
Uuid string `json:"uuid"`
}
type DataConnectMachineClient struct {
MachineUuid string `json:"machine-uuid"`
ClientUuid string `json:"client-uuid"`
}
type DataDisconnectMachineClient struct {
MachineUuid string `json:"machine-uuid"`
ClientUuid string `json:"client-uuid"`
}
type DataChallengeRequest struct {
Challenge string `json:"challenge"`
}
type DataChallengeResponse struct {
Challenge string `json:"challenge"`
}
type MsgServerStatus struct {
Type string `json:"type"`
Data struct {
Clients []struct {
Uuid string
DisplayName string
ShortUuid string
Status string
MachineUuid string
LastPingTime string
}
Machines []struct {
Uuid string
MachineName string
ProcessID int
Platform string
Status string
ClientUuid string
JammerDisplayName string
LastSnapshotTime string
}
} `json:"data"`
}
type Msg struct {
Type string `json:"type"`
Identity DataIdentity `json:"identity,omitempty"`
TicState machines.TicState `json:"tic-state,omitempty"`
ServerStatus ClientServerStatus `json:"server-status,omitempty"`
Log DataLog `json:"log,omitempty"`
ConnectMachineClient DataConnectMachineClient `json:"connect-machine-client,omitempty"`
DisconnectMachineClient DataDisconnectMachineClient `json:"disconnect-machine-client,omitempty"`
CloseMachine DataCloseMachine `json:"close-machine,omitempty"`
ChallengeRequest DataChallengeRequest `json:"challenge-request,omitempty"`
ChallengeResponse DataChallengeResponse `json:"challenge-response,omitempty"`
}