-
Notifications
You must be signed in to change notification settings - Fork 3
/
consts.go
83 lines (69 loc) · 1.82 KB
/
consts.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
80
81
82
83
package rtm2_sdk
// uri
const (
UriMessageSubscribe = 0
UriMessageUnsubscribe = 1
UriMessagePublish = 2
UriMessageEvent = 3
UriStreamJoin = 4
UriStreamLeave = 5
UriStreamJoinTopic = 6
UriStreamLeaveTopic = 7
UriStreamPublish = 8
UriStreamEvent = 9
UriStreamTopicEvent = 10
UriStreamSubTopic = 11
UriStreamUnsubTopic = 12
UriStorageOpChannelMetaData = 24
UriStorageGetChannelMetaData = 25
UriStorageOpUserMetaData = 26
UriStorageGetUserMetaData = 27
UriStorageSubscribeUserMetaData = 28
UriStorageUnSubscribeUserMetaData = 29
UriStorageChannelEvent = 30
UriStorageUserEvent = 31
UriPresenceWhereNow = 36
UriPresenceWhoNow = 37
UriPresenceSetState = 38
UriPresenceGetState = 39
UriPresenceRemoveState = 40
UriPresenceEvent = 41
UriLogin = 100
UriLogout = 101
UriConnectStateChange = 102
UriSetParam = 103
UriRenewToken = 104
UriLockAcquire = 105
UriLockGet = 106
UriLockRelease = 107
UriLockRemove = 108
UriLockRevoke = 109
UriLockSet = 110
UriLockEvent = 111
UriTokenPrivilegeExpire = 112
UriCommonRequest = 0xFFE
UriCommonResp = 0xFFF
invalidUri = -1
kParamSidecarEndpoint = "golang_sidecar_endpoint"
kParamSidecarPort = "golang_sidecar_port"
kParamSidecarPath = "golang_sidecar_path"
DefaultSidecarPort = 7001
)
// channel type
const (
Msg = 0
Stream = 1
)
// topic event type
const (
TopicEventSnapshot = 0
TopicEventJoin = 1
TopicEventLeave = 2
)
func IsEvent(uri int32) bool {
switch uri {
case UriMessageEvent, UriStreamEvent, UriStreamTopicEvent, UriStorageChannelEvent, UriStorageUserEvent, UriConnectStateChange, UriPresenceEvent, UriLockEvent, UriTokenPrivilegeExpire:
return true
}
return false
}