Documentation
¶
Index ¶
- func CreateMqttClientId(deviceId string, scopeConfig *config.ScopeConfig) string
- func FormatTopic(topic, deviceId string) string
- func GetDateTime(timeStr string) (time.Time, error)
- func GetEventTimeStamp() string
- func GetServer() *model.ServerInfo
- func GetTopicRequestId(topic string) string
- func HmacSha256(data string, secret string) (string, error)
- func Interface2JsonString(v interface{}) string
- func OsName() string
- func SavePwd(server model.ServerInfo) error
- func SdkInfo() map[string]string
- func Sha256FromFile(filePath string) (int, string, error)
- func SmartFileName(filename string) string
- func TimeStamp() string
- func VerifyConnection(serverCaPool *x509.CertPool) func(stats tls.ConnectionState) error
- type CircularQueue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateMqttClientId ¶
func CreateMqttClientId(deviceId string, scopeConfig *config.ScopeConfig) string
func FormatTopic ¶
func GetEventTimeStamp ¶
func GetEventTimeStamp() string
GetEventTimeStamp 设备采集数据UTC时间(格式:yyyyMMdd'T'HHmmss'Z'),如:20161219T114920Z。 设备上报数据不带该参数或参数格式错误时,则数据上报时间以平台时间为准。
func GetServer ¶
func GetServer() *model.ServerInfo
func GetTopicRequestId ¶
func Interface2JsonString ¶
func Interface2JsonString(v interface{}) string
func SavePwd ¶
func SavePwd(server model.ServerInfo) error
func TimeStamp ¶
func TimeStamp() string
时间戳:为设备连接平台时的UTC时间,格式为YYYYMMDDHH,如UTC 时间2018/7/24 17:56:20 则应表示为2018072417。
func VerifyConnection ¶
func VerifyConnection(serverCaPool *x509.CertPool) func(stats tls.ConnectionState) error
VerifyConnection 使用自定义方式校验证书,忽略主机名校验
Types ¶
type CircularQueue ¶
type CircularQueue struct {
// contains filtered or unexported fields
}
func NewCircularQueue ¶
func NewCircularQueue(capacity int) *CircularQueue
func (*CircularQueue) Len ¶
func (cq *CircularQueue) Len() int
func (*CircularQueue) Pop ¶
func (cq *CircularQueue) Pop() interface{}
func (*CircularQueue) Push ¶
func (cq *CircularQueue) Push(value interface{})
Click to show internal directories.
Click to hide internal directories.