Documentation
¶
Index ¶
Constants ¶
View Source
const ( CONNECT = 1 // CONNECT packet does not include any flags in the packet type CONNACK = 2 // CONNECT ACKNOWLEDGEMENT packet does not include any flags in the packet type PUBLISH = 3 // PUBLISH packet without any flags PUBACK = 4 // PUBLISH ACKNOWLEDGMENT packet SUBSCRIBE = 8 // SUBSCRIBE packet without any flags SUBACK = 9 // SUBSCRIBE ACKNOWLEDGMENT packet PINGREQ = 12 // PING_REQ packet without any flags PINGRESP = 13 // PING_RESP packet without any flags )
View Source
const ( DUP = 0x08 RETAIN = 0x01 )
Variables ¶
This section is empty.
Functions ¶
func CreateConnectFlagByte ¶
func CreateConnectFlagByte(flags ConnectFlags) uint8
Types ¶
type ConnACKPacket ¶
type ConnACKPacket struct {
Packet byte
}
func (*ConnACKPacket) Compress ¶
func (p *ConnACKPacket) Compress() byte
func (*ConnACKPacket) Decompress ¶
func (p *ConnACKPacket) Decompress(packetByte byte) error
type ConnectFlags ¶
type ConnectPacket ¶
type ConnectPacket struct {
Packet byte
}
func (*ConnectPacket) Compress ¶
func (p *ConnectPacket) Compress() byte
func (*ConnectPacket) Decompress ¶
func (p *ConnectPacket) Decompress(packetByte byte) error
type PublishPacket ¶
type PublishPacket struct { DUP uint8 // duplicate delivery flag (bit 3) - this is 1 or 0, 1 = is re-delivery/duplicate of message QOSLevel QoS // quality of service level (bit 2 & 1) RetainFlag uint8 // retain flag (bit 0) - if set to 1, the message should be retained by the broker and delivered to future subscribers with a matching subscription // contains filtered or unexported fields }
00110010 0011 0010
func (*PublishPacket) Compress ¶
func (p *PublishPacket) Compress() byte
func (*PublishPacket) Decompress ¶
func (p *PublishPacket) Decompress(packetByte byte) error
func (*PublishPacket) GetPacketType ¶
func (p *PublishPacket) GetPacketType() uint8
type SubscribePacket ¶
type SubscribePacket struct {
// contains filtered or unexported fields
}
func (*SubscribePacket) Compress ¶
func (sp *SubscribePacket) Compress() byte
func (*SubscribePacket) Decompress ¶
func (sp *SubscribePacket) Decompress(packetByte byte) error
func (*SubscribePacket) GetPacketType ¶
func (sp *SubscribePacket) GetPacketType() uint8
Click to show internal directories.
Click to hide internal directories.