Documentation ¶
Index ¶
- Constants
- Variables
- type AdvertiseMessage
- type ConnackMessage
- type ConnectMessage
- type DisconnectMessage
- type GwInfoMessage
- type Header
- type Message
- type PingreqMessage
- type PingrespMessage
- type PubackMessage
- type PubcompMessage
- type PublishMessage
- type PubrecMessage
- type PubrelMessage
- type RegackMessage
- type RegisterMessage
- type SearchGwMessage
- type SubackMessage
- type SubscribeMessage
- type UnsubackMessage
- type UnsubscribeMessage
- type WillMsgMessage
- type WillMsgReqMessage
- type WillMsgRespMessage
- type WillMsgUpdateMessage
- type WillTopicMessage
- type WillTopicReqMessage
- type WillTopicRespMessage
- type WillTopicUpdateMessage
Constants ¶
View Source
const ( TOPICIDTYPE = 0x03 CLEANSESSION = 0x04 WILLFLAG = 0x08 RETAINFLAG = 0x10 QOSBITS = 0x60 DUPFLAG = 0x80 )
Flags
View Source
const ( ACCEPTED = 0x00 REJ_CONGESTION = 0x01 REJ_INVALID_TID = 0x02 REJ_NOT_SUPORTED = 0x03 )
Errors
View Source
const ( ADVERTISE = 0x00 SEARCHGW = 0x01 GWINFO = 0x02 CONNECT = 0x04 CONNACK = 0x05 WILLTOPICREQ = 0x06 WILLTOPIC = 0x07 WILLMSGREQ = 0x08 WILLMSG = 0x09 REGISTER = 0x0A REGACK = 0x0B PUBLISH = 0x0C PUBACK = 0x0D PUBCOMP = 0x0E PUBREC = 0x0F PUBREL = 0x10 SUBSCRIBE = 0x12 SUBACK = 0x13 UNSUBSCRIBE = 0x14 UNSUBACK = 0x15 PINGREQ = 0x16 PINGRESP = 0x17 DISCONNECT = 0x18 WILLTOPICUPD = 0x1A WILLTOPICRESP = 0x1B WILLMSGUPD = 0x1C WILLMSGRESP = 0x1D )
Message Types
Variables ¶
View Source
var MessageNames = map[byte]string{ ADVERTISE: "ADVERTISE", SEARCHGW: "SEARCHGW", GWINFO: "GWINFO", CONNECT: "CONNECT", CONNACK: "CONNACK", WILLTOPICREQ: "WILLTOPICREQ", WILLTOPIC: "WILLTOPIC", WILLMSGREQ: "WILLMSGREQ", WILLMSG: "WILLMSG", REGISTER: "REGISTER", REGACK: "REGACK", PUBLISH: "PUBLISH", PUBACK: "PUBACK", PUBCOMP: "PUBCOMP", PUBREC: "PUBREC", PUBREL: "PUBREL", SUBSCRIBE: "SUBSCRIBE", SUBACK: "SUBACK", UNSUBSCRIBE: "UNSUBSCRIBE", UNSUBACK: "UNSUBACK", PINGREQ: "PINGREQ", PINGRESP: "PINGRESP", DISCONNECT: "DISCONNECT", WILLTOPICUPD: "WILLTOPICUPD", WILLTOPICRESP: "WILLTOPICRESP", WILLMSGUPD: "WILLMSGUPD", WILLMSGRESP: "WILLMSGRESP", }
Functions ¶
This section is empty.
Types ¶
type AdvertiseMessage ¶
func (*AdvertiseMessage) MessageType ¶
func (a *AdvertiseMessage) MessageType() byte
func (*AdvertiseMessage) Unpack ¶
func (a *AdvertiseMessage) Unpack(b io.Reader)
func (*AdvertiseMessage) Write ¶
func (a *AdvertiseMessage) Write(w io.Writer) error
type ConnackMessage ¶
func (*ConnackMessage) MessageType ¶
func (c *ConnackMessage) MessageType() byte
func (*ConnackMessage) Unpack ¶
func (c *ConnackMessage) Unpack(b io.Reader)
func (*ConnackMessage) Write ¶
func (c *ConnackMessage) Write(w io.Writer) error
type ConnectMessage ¶
type ConnectMessage struct { Header Will bool CleanSession bool ProtocolId byte Duration uint16 ClientId []byte }
func (*ConnectMessage) MessageType ¶
func (c *ConnectMessage) MessageType() byte
func (*ConnectMessage) Unpack ¶
func (c *ConnectMessage) Unpack(b io.Reader)
func (*ConnectMessage) Write ¶
func (c *ConnectMessage) Write(w io.Writer) error
type DisconnectMessage ¶
func (*DisconnectMessage) MessageType ¶
func (d *DisconnectMessage) MessageType() byte
func (*DisconnectMessage) Unpack ¶
func (d *DisconnectMessage) Unpack(b io.Reader)
func (*DisconnectMessage) Write ¶
func (d *DisconnectMessage) Write(w io.Writer) error
type GwInfoMessage ¶
func (*GwInfoMessage) MessageType ¶
func (g *GwInfoMessage) MessageType() byte
func (*GwInfoMessage) Unpack ¶
func (g *GwInfoMessage) Unpack(b io.Reader)
func (*GwInfoMessage) Write ¶
func (g *GwInfoMessage) Write(w io.Writer) error
type Message ¶
type PingreqMessage ¶
func (*PingreqMessage) MessageType ¶
func (p *PingreqMessage) MessageType() byte
func (*PingreqMessage) Unpack ¶
func (p *PingreqMessage) Unpack(b io.Reader)
func (*PingreqMessage) Write ¶
func (p *PingreqMessage) Write(w io.Writer) error
type PingrespMessage ¶
type PingrespMessage struct {
Header
}
func (*PingrespMessage) MessageType ¶
func (p *PingrespMessage) MessageType() byte
func (*PingrespMessage) Unpack ¶
func (p *PingrespMessage) Unpack(b io.Reader)
func (*PingrespMessage) Write ¶
func (p *PingrespMessage) Write(w io.Writer) error
type PubackMessage ¶
func (*PubackMessage) MessageType ¶
func (p *PubackMessage) MessageType() byte
func (*PubackMessage) Unpack ¶
func (p *PubackMessage) Unpack(b io.Reader)
func (*PubackMessage) Write ¶
func (p *PubackMessage) Write(w io.Writer) error
type PubcompMessage ¶
func (*PubcompMessage) MessageType ¶
func (p *PubcompMessage) MessageType() byte
func (*PubcompMessage) Unpack ¶
func (p *PubcompMessage) Unpack(b io.Reader)
func (*PubcompMessage) Write ¶
func (p *PubcompMessage) Write(w io.Writer) error
type PublishMessage ¶
type PublishMessage struct { Header Dup bool Retain bool Qos byte TopicIdType byte TopicId uint16 MessageId uint16 Data []byte }
func NewPublishMessage ¶
func (*PublishMessage) MessageType ¶
func (p *PublishMessage) MessageType() byte
func (*PublishMessage) Unpack ¶
func (p *PublishMessage) Unpack(b io.Reader)
func (*PublishMessage) Write ¶
func (p *PublishMessage) Write(w io.Writer) error
type PubrecMessage ¶
func (*PubrecMessage) MessageType ¶
func (p *PubrecMessage) MessageType() byte
func (*PubrecMessage) Unpack ¶
func (p *PubrecMessage) Unpack(b io.Reader)
func (*PubrecMessage) Write ¶
func (p *PubrecMessage) Write(w io.Writer) error
type PubrelMessage ¶
func (*PubrelMessage) MessageType ¶
func (p *PubrelMessage) MessageType() byte
func (*PubrelMessage) Unpack ¶
func (p *PubrelMessage) Unpack(b io.Reader)
func (*PubrelMessage) Write ¶
func (p *PubrelMessage) Write(w io.Writer) error
type RegackMessage ¶
func NewRegackMessage ¶
func NewRegackMessage(TopicId uint16, MessageId uint16, rc byte) *RegackMessage
func (*RegackMessage) MessageType ¶
func (r *RegackMessage) MessageType() byte
func (*RegackMessage) Unpack ¶
func (r *RegackMessage) Unpack(b io.Reader)
func (*RegackMessage) Write ¶
func (r *RegackMessage) Write(w io.Writer) error
type RegisterMessage ¶
func NewRegisterMessage ¶
func NewRegisterMessage(TopicId, MessageId uint16, TopicName []byte) *RegisterMessage
func (*RegisterMessage) MessageType ¶
func (r *RegisterMessage) MessageType() byte
func (*RegisterMessage) Unpack ¶
func (r *RegisterMessage) Unpack(b io.Reader)
func (*RegisterMessage) Write ¶
func (r *RegisterMessage) Write(w io.Writer) error
type SearchGwMessage ¶
func (*SearchGwMessage) MessageType ¶
func (s *SearchGwMessage) MessageType() byte
func (*SearchGwMessage) Unpack ¶
func (s *SearchGwMessage) Unpack(b io.Reader)
func (*SearchGwMessage) Write ¶
func (s *SearchGwMessage) Write(w io.Writer) error
type SubackMessage ¶
func NewSubackMessage ¶
func NewSubackMessage(TopicId uint16, MessageId uint16, Qos byte, rc byte) *SubackMessage
func (*SubackMessage) MessageType ¶
func (s *SubackMessage) MessageType() byte
func (*SubackMessage) Unpack ¶
func (s *SubackMessage) Unpack(b io.Reader)
func (*SubackMessage) Write ¶
func (s *SubackMessage) Write(w io.Writer) error
type SubscribeMessage ¶
type SubscribeMessage struct { Header Dup bool Qos byte TopicIdType byte MessageId uint16 TopicId uint16 TopicName []byte }
func (*SubscribeMessage) MessageType ¶
func (s *SubscribeMessage) MessageType() byte
func (*SubscribeMessage) Unpack ¶
func (s *SubscribeMessage) Unpack(b io.Reader)
func (*SubscribeMessage) Write ¶
func (s *SubscribeMessage) Write(w io.Writer) error
type UnsubackMessage ¶
func (*UnsubackMessage) MessageType ¶
func (u *UnsubackMessage) MessageType() byte
func (*UnsubackMessage) Unpack ¶
func (u *UnsubackMessage) Unpack(b io.Reader)
func (*UnsubackMessage) Write ¶
func (u *UnsubackMessage) Write(w io.Writer) error
type UnsubscribeMessage ¶
type UnsubscribeMessage struct { Header TopicIdType byte MessageId uint16 TopicId uint16 TopicName []byte }
func (*UnsubscribeMessage) MessageType ¶
func (u *UnsubscribeMessage) MessageType() byte
func (*UnsubscribeMessage) Unpack ¶
func (u *UnsubscribeMessage) Unpack(b io.Reader)
func (*UnsubscribeMessage) Write ¶
func (u *UnsubscribeMessage) Write(w io.Writer) error
type WillMsgMessage ¶
func (*WillMsgMessage) MessageType ¶
func (wm *WillMsgMessage) MessageType() byte
func (*WillMsgMessage) Unpack ¶
func (wm *WillMsgMessage) Unpack(b io.Reader)
func (*WillMsgMessage) Write ¶
func (wm *WillMsgMessage) Write(w io.Writer) error
type WillMsgReqMessage ¶
type WillMsgReqMessage struct {
Header
}
func (*WillMsgReqMessage) MessageType ¶
func (wm *WillMsgReqMessage) MessageType() byte
func (*WillMsgReqMessage) Unpack ¶
func (wm *WillMsgReqMessage) Unpack(b io.Reader)
func (*WillMsgReqMessage) Write ¶
func (wm *WillMsgReqMessage) Write(w io.Writer) error
type WillMsgRespMessage ¶
func (*WillMsgRespMessage) MessageType ¶
func (wm *WillMsgRespMessage) MessageType() byte
func (*WillMsgRespMessage) Unpack ¶
func (wm *WillMsgRespMessage) Unpack(b io.Reader)
func (*WillMsgRespMessage) Write ¶
func (wm *WillMsgRespMessage) Write(w io.Writer) error
type WillMsgUpdateMessage ¶
func (*WillMsgUpdateMessage) MessageType ¶
func (wm *WillMsgUpdateMessage) MessageType() byte
func (*WillMsgUpdateMessage) Unpack ¶
func (wm *WillMsgUpdateMessage) Unpack(b io.Reader)
func (*WillMsgUpdateMessage) Write ¶
func (wm *WillMsgUpdateMessage) Write(w io.Writer) error
type WillTopicMessage ¶
func (*WillTopicMessage) MessageType ¶
func (wt *WillTopicMessage) MessageType() byte
func (*WillTopicMessage) Unpack ¶
func (wt *WillTopicMessage) Unpack(b io.Reader)
func (*WillTopicMessage) Write ¶
func (wt *WillTopicMessage) Write(w io.Writer) error
type WillTopicReqMessage ¶
type WillTopicReqMessage struct {
Header
}
func (*WillTopicReqMessage) MessageType ¶
func (wt *WillTopicReqMessage) MessageType() byte
func (*WillTopicReqMessage) Unpack ¶
func (wt *WillTopicReqMessage) Unpack(b io.Reader)
func (*WillTopicReqMessage) Write ¶
func (wt *WillTopicReqMessage) Write(w io.Writer) error
type WillTopicRespMessage ¶
func (*WillTopicRespMessage) MessageType ¶
func (wt *WillTopicRespMessage) MessageType() byte
func (*WillTopicRespMessage) Unpack ¶
func (wt *WillTopicRespMessage) Unpack(b io.Reader)
func (*WillTopicRespMessage) Write ¶
func (wt *WillTopicRespMessage) Write(w io.Writer) error
type WillTopicUpdateMessage ¶
func (*WillTopicUpdateMessage) MessageType ¶
func (wt *WillTopicUpdateMessage) MessageType() byte
func (*WillTopicUpdateMessage) Unpack ¶
func (wt *WillTopicUpdateMessage) Unpack(b io.Reader)
func (*WillTopicUpdateMessage) Write ¶
func (wt *WillTopicUpdateMessage) Write(w io.Writer) error
Source Files ¶
- advertise.go
- connack.go
- connect.go
- disconnect.go
- gwinfo.go
- packets.go
- pingreq.go
- pingresp.go
- puback.go
- pubcomp.go
- publish.go
- pubrec.go
- pubrel.go
- regack.go
- register.go
- searchgw.go
- suback.go
- subscribe.go
- unsuback.go
- unsubscribe.go
- willmsg.go
- willmsgreq.go
- willmsgresp.go
- willmsgupd.go
- willtopic.go
- willtopicreq.go
- willtopicresp.go
- willtopicupd.go
Click to show internal directories.
Click to hide internal directories.