Documentation ¶
Index ¶
- Constants
- func NewPacketIdentifier() int
- func Read2BytesInt(a []byte, i int) int
- func Read4BytesInt(a []byte) uint32
- func ReadFromByteSlice(buff []byte) ([]byte, error)
- func ReadVarInt(props []byte) (int, int, error)
- func Write2BytesInt(i int) []byte
- func WriteVarInt(x int) []byte
- type Packet
- func Connack(sessionPresent bool, ReasonCode uint8, protocolVersion uint8) Packet
- func Connect() Packet
- func PacketParse(session *model.RunningSession, buf []byte) (Packet, error)
- func PingResp() Packet
- func Puback(packetIdentifier int, ReasonCode uint8, protocolVersion uint8) Packet
- func Pubcomp(packetIdentifier int, ReasonCode uint8, protocolVersion uint8) Packet
- func Publish(protocolVersion uint8, qos uint8, retain bool, topic string, ...) Packet
- func Pubrec(packetIdentifier int, ReasonCode uint8, protocolVersion uint8) Packet
- func Pubrel(packetIdentifier int, ReasonCode uint8, protocolVersion uint8) Packet
- func Start(buff []byte) (Packet, error)
- func Suback(packetIdentifier int, ReasonCodes []uint8, protocolVersion uint8) Packet
- func Unsuback(packetIdentifier int, ReasonCodes []uint8, protocolVersion uint8) Packet
- func (p *Packet) ApplicationMessage() []byte
- func (p *Packet) CompletePacket(buff []byte) int
- func (p *Packet) Dup() bool
- func (p *Packet) Flags() byte
- func (p *Packet) PacketComplete() bool
- func (p *Packet) PacketIdentifier() int
- func (p *Packet) PacketLength() int
- func (p *Packet) PacketType() byte
- func (p *Packet) Parse(session *model.RunningSession) int
- func (p *Packet) Payload() []byte
- func (p *Packet) PublishTopic() []byte
- func (p *Packet) QoS() byte
- func (p *Packet) RemainingBytes() []byte
- func (p *Packet) Retain() bool
- func (p *Packet) SessionExpiryInterval() int64
- func (p *Packet) ToByteSlice() []byte
- type Properties
- type Property
Constants ¶
View Source
const ASSIGNED_CLIENT_IDENTIFIER = 0x12
View Source
const AUTHENTICATION_DATA = 0x16
View Source
const AUTHENTICATION_METHOD = 0x15
View Source
const CONNECT_OK = 0
connect response
View Source
const CONTENT_TYPE = 0x03
View Source
const CORRELATION_DATA = 0x09
View Source
const MALFORMED_PACKET = 0x81
View Source
const MAXIMUM_PACKET_SIZE = 0x27
View Source
const MAXIMUM_QOS = 0x24
View Source
const MESSAGE_EXPIRY_INTERVAL = 0x02
View Source
const PACKET_MAX_SIZE = 65000
View Source
const PACKET_TYPE_CONNACK = 2
View Source
const PACKET_TYPE_CONNECT = 1
View Source
const PACKET_TYPE_DISCONNECT = 14
View Source
const PACKET_TYPE_PINGREQ = 12
View Source
const PACKET_TYPE_PINGRES = 13
View Source
const PACKET_TYPE_PUBACK = 4
View Source
const PACKET_TYPE_PUBCOMP = 7
View Source
const PACKET_TYPE_PUBLISH = 3
View Source
const PACKET_TYPE_PUBREC = 5
View Source
const PACKET_TYPE_PUBREL = 6
View Source
const PACKET_TYPE_SUBACK = 9
View Source
const PACKET_TYPE_SUBSCRIBE = 8
View Source
const PACKET_TYPE_UNSUBACK = 11
View Source
const PACKET_TYPE_UNSUBSCRIBE = 10
View Source
const PAYLOAD_FORMAT_INDICATOR = 0x01
View Source
const PUBACK_NOT_AUTHORIZED = 0x87
View Source
const PUBACK_NO_MATCHING_SUBSCRIBERS = 0x10
View Source
const PUBACK_SUCCESS = 0x00
publish ack in QoS 1
View Source
const PUBCOMP_SUCCESS = 0x00
publish in QoS 2
View Source
const PUBREC_NOT_AUTHORIZED = 0x87
View Source
const PUBREC_SUCCESS = 0x00
View Source
const PUBREL_SUCCESS = 0x00
View Source
const REASON_STRING = 0x1F
View Source
const RECEIVE_MAXIMUM = 0x21
View Source
const REQUEST_PROBLEM_INFORMATION = 0x17
View Source
const REQUEST_RESPONSE_INFORMATION = 0x19
View Source
const RESPONSE_INFORMATION = 0x1A
View Source
const RESPONSE_TOPIC = 0x08
View Source
const RETAIN_AVAILABLE = 0x25
View Source
const SERVER_KEEP_ALIVE = 0x13
View Source
const SERVER_REFERENCE = 0x1C
View Source
const SESSION_EXPIRY_INTERVAL = 0x11
View Source
const SESSION_TAKEN_OVER = 0x8E
View Source
const SHARED_SUBSCRIPTION_AVAILABLE = 0x2A
View Source
const SUBSCRIPTION_IDENTIFIER = 0x0B
View Source
const SUBSCRIPTION_IDENTIFIER_AVAILABLE = 0x29
View Source
const TOPIC_ALIAS = 0x23
View Source
const TOPIC_ALIAS_MAXIMUM = 0x22
View Source
const UNSPECIFIED_ERROR = 0x80
View Source
const UNSUPPORTED_PROTOCOL_VERSION = 0x84
View Source
const USER_PROPERTY = 0x26
View Source
const WILDCARD_SUBSCRIPTION_AVAILABLE = 0x28
View Source
const WILL_DELAY_INTERVAL = 0x18
Variables ¶
This section is empty.
Functions ¶
func NewPacketIdentifier ¶
func NewPacketIdentifier() int
func Read2BytesInt ¶
func Read4BytesInt ¶
func ReadFromByteSlice ¶
func Write2BytesInt ¶
func WriteVarInt ¶
Types ¶
type Packet ¶
type Packet struct { // CONNACK, PUBACK, PUBREC, PUBREL, PUBCOMP, DISCONNECT ReasonCode uint8 // metadata Subscriptions []model.Subscription Topic string // contains filtered or unexported fields }
func PacketParse ¶
func PacketParse(session *model.RunningSession, buf []byte) (Packet, error)
func (*Packet) ApplicationMessage ¶
func (*Packet) CompletePacket ¶
func (*Packet) PacketComplete ¶
func (*Packet) PacketIdentifier ¶
func (*Packet) PacketLength ¶
func (*Packet) PacketType ¶
func (*Packet) PublishTopic ¶
func (*Packet) RemainingBytes ¶
func (*Packet) SessionExpiryInterval ¶
func (*Packet) ToByteSlice ¶
type Properties ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.