/
protocol.go
60 lines (46 loc) · 1012 Bytes
/
protocol.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
package mediaserver
// Naming convention in the package.
// When a action is required we prefix it with CMD (Command)
// When a data or information is passed we prefix variable as MSG(Message)
// Telemetry command to send some telemetry data
const CMD_Telemetry = "Telemetry"
const CMD_Auth = "Auth"
//Client commands
const (
CMD_StartSession = "StartSession"
CMD_ReceiveChunk = "ReceiveChunk"
CMD_EndSession = "EndSession"
)
// Admin commands
const(
CMD_MonitorSession = "MonitorSession"
CMD_JoinSession = "JoinSession" // Join to an existing user session
)
// Server commands
const (
CMD_ReceiveSessionId = "ReceiveSessionId"
)
type ClientMsg struct {
Command string
SessionId string
AuthToken string
Data string
}
type ServerMsg struct {
Command string
Data string
SessionId string
}
type StartConversationData struct {
Name string
Type string
Version string
}
type TelemetryData struct {
Type string
Data string
}
type ClientLogData struct {
}
type ClientMetricsData struct {
}