-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathconfig.go
46 lines (40 loc) · 1.13 KB
/
config.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
package aliyuniot
const (
DefaultRegionID = "cn-shanghai"
BrokerURL = "%s%s.iot-as-mqtt.%s.aliyuncs.com:%d"
)
var (
tlsPrefix = []string{"tls://", "mqtts://", "wss://"}
)
type DeviceConfig struct {
RegionID string
SignAlgorithm string
ProductKey string
DeviceName string
DeviceSecret string
BrokerURL string
ClientID string
TLS bool
Websocket bool
}
const (
DefaultProtocol = ProtocolWS
ProtocolWS = "ws://"
ProtocolTCP = "tcp://"
ProtocolTLS = "tls://"
ProtocolWSS = "wss://"
// ProtocolMQTT = "mqtt://"
// ProtocolMQTTS = "mqtts://"
)
var (
PostProperty = "thing.event.property.post"
PostEvent = "thing.event.%s.post"
ThingServiceMethodPrefix = "thing.service."
)
const (
ServiceTopic = "/sys/%s/%s/thing/service/%s"
PropertyPostTopic = "/sys/%s/%s/thing/event/property/post"
PropertyPostReplyTopic = "/sys/%s/%s/thing/event/property/post_reply"
EventPostTopic = "/sys/%s/%s/thing/event/%s/post"
EventPostReplyTopic = "/sys/%s/%s/thing/event/%s/post_reply"
)