-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathproto.go
More file actions
63 lines (50 loc) · 1.48 KB
/
proto.go
File metadata and controls
63 lines (50 loc) · 1.48 KB
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
package thingsdb
// Proto is used as protocol type used by ThingsDB.
type Proto int8
const (
/*
* Events
*/
// ProtoOnNodeStatus the connected node has changed it's status
ProtoOnNodeStatus Proto = 0
// ProtoOnWarn warning message for the connected client
ProtoOnWarn Proto = 5
// ProtoOnRoomJoin initial join
ProtoOnRoomJoin Proto = 6
// ProtoOnRoomLeave leave join
ProtoOnRoomLeave Proto = 7
// ProtoOnRoomEvent emit event
ProtoOnRoomEvent Proto = 8
// ProtoOnRoomDelete room removed from ThingsDB
ProtoOnRoomDelete Proto = 9
/*
* Responses
*/
// ProtoResPong responds with `nil`
ProtoResPong Proto = 16
// ProtoResOk responds with `nil`
ProtoResOk Proto = 17
// ProtoResData responds with `...`
ProtoResData Proto = 18
// ProtoResError responds with `{error_msg:..., error_code:,...}`
ProtoResError Proto = 19
/*
* Requests
*/
// ProtoReqPing requires `nil`
ProtoReqPing Proto = 32
// ProtoReqAuth requires `[username, password]`
ProtoReqAuth Proto = 33
// ProtoReqQuery requires `[scope, query [, variable]]`
ProtoReqQuery Proto = 34
// ProtoReqRun requires `[scope, procedure[, arguments]]`
ProtoReqRun Proto = 37
// ProtoReqJoin requires `[scope, room ids...]`
ProtoReqJoin Proto = 38
// ProtoReqLeave requires `[scope, room ids...]`
ProtoReqLeave Proto = 39
// ProtoReqEmit requires `[scope, roomId, event, arguments...]`
ProtoReqEmit Proto = 40
// ProtoReqEmitPeers requires `[scope, roomId, event, arguments...]`
ProtoReqEmitPeers Proto = 41
)