Documentation
¶
Index ¶
Constants ¶
View Source
const ( DisconnectByServer = "disconnect by server" DisconnectByClient = "disconnect by client" DisconnectByKeepAliveTimeOut = "disconnect by keep alive time out" )
View Source
const ( CodeRegister = 1 CodeHeartBeat = 2 CodeData = 3 CodeRegisterReplay = CodeRegister + 0x80 CodeDataReplay = CodeData + 0x80 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Agreement ¶
type Agreement struct {
Code int `json:"code"` //命令码
Timestamp int64 `json:"timestamp"` //时间戳
Data string `json:"data,omitempty"` //数据 明文经过AES算法加密后的密文
DiscardedData []byte `json:"-"`
}
func ParseAgreement ¶
type AgreementData ¶
type AgreementData struct {
Key string `json:"key,omitempty"` // 关键字
Payload map[string]interface{} `json:"payload,omitempty"` //自定义数据
RandomStr string `json:"randomStr"` //随机字符串
}
func Decrypt ¶
func Decrypt(data string) (rsp AgreementData, err error)
Click to show internal directories.
Click to hide internal directories.