forked from crow-misia/go-push-receiver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants.go
73 lines (61 loc) · 1.89 KB
/
constants.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
/*
* Copyright (c) 2019 Zenichi Amano
*
* This file is part of go-push-receiver, which is MIT licensed.
* See http://opensource.org/licenses/MIT
*/
package pushreceiver
// tagType is FCM Request/Response Tag type
type tagType byte
// GCM / FCM constants.
const (
registerURL = "https://android.clients.google.com/c2dm/register3"
checkinURL = "https://android.clients.google.com/checkin"
chromeVersion = "63.0.3234.0"
fcmServerKey = "BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4"
fcmSubscribe = "https://fcm.googleapis.com/fcm/connect/subscribe"
fcmEndpoint = "https://fcm.googleapis.com/fcm/send/"
mtalkServer = "mtalk.google.com:5228"
mcsDomain = "mcs.android.com"
fcmVersion = 41
// Packet defines
// of bytes a MCS version packet consumes.
versionPacketLen = 1
// of bytes a tag packet consumes.
tagPacketLen = 1
sizePacketLenMin = 1
sizePacketLenMax = 5
)
// Default values
const (
// default Dial timeout second
defaultDialTimeout = 30
// default keep-alive duration (minutes)
defaultKeepAlive = 1
// Default Base backoff second
defaultBackoffBase = 5
// Default Max backoff second
defaultBackoffMax = 15 * 60
// Default Heartbeat period (minutes)
defaultHeartbeatPeriod = 10
)
// Tag enumeration.
const (
tagHeartbeatPing tagType = 0
tagHeartbeatAck tagType = 1
tagLoginRequest tagType = 2
tagLoginResponse tagType = 3
tagClose tagType = 4
tagMessageStanza tagType = 5
tagPresenceStanza tagType = 6
tagIqStanza tagType = 7
tagDataMessageStanza tagType = 8
tagBatchPresenceStanza tagType = 9
tagStreamErrorStanza tagType = 10
tagHTTPRequest tagType = 11
tagHTTPResponse tagType = 12
tagBindAccountRequest tagType = 13
tagBindAccountResponse tagType = 14
tagTalkMetadata tagType = 15
tagNumProtoTypes tagType = 16
)