package
0.0.0-20220824021342-5961e9c4d224
Repository: https://github.com/xiaodingding/iotfast.git
Documentation: pkg.go.dev
# Functions
DecodeRemainLength 将remain length 转成byte表示
DecodeRemainLength puts the length int into bytes.
DecodeUTF8String decodes the UTF-8 encoded strings into bytes, returns the decoded bytes, bytes size and error.
EncodeRemainLength 读remainLength,如果格式错误返回 error
EncodeRemainLength reads the remain length bytes from bufio.Reader and returns length int.
EncodeUTF8String encodes the bytes into UTF-8 encoded strings, returns the encoded bytes, bytes size and error.
No description provided by the author
No description provided by the author
No description provided by the author
NewConnackPacket returns a Connack instance by the given FixHeader and io.Reader.
NewConnectPacket returns a Connect instance by the given FixHeader and io.Reader.
NewDisConnectPackets returns a Disconnect instance by the given FixHeader and io.Reader.
NewMockPacket creates a new mock instance.
NewPacket returns a packet representing the decoded MQTT packet and an error.
NewPingreqPacket returns a Pingreq instance by the given FixHeader and io.Reader.
NewPingrespPacket returns a Pingresp instance by the given FixHeader and io.Reader.
NewPubackPacket returns a Puback instance by the given FixHeader and io.Reader.
NewPubcompPacket returns a Pubcomp instance by the given FixHeader and io.Reader.
NewPublishPacket returns a Publish instance by the given FixHeader and io.Reader.
NewPubrecPacket returns a Pubrec instance by the given FixHeader and io.Reader.
NewPubrelPacket returns a Pubrel instance by the given FixHeader and io.Reader.
NewReader returns a new Reader.
NewSubackPacket returns a Suback instance by the given FixHeader and io.Reader.
NewSubscribePacket returns a Subscribe instance by the given FixHeader and io.Reader.
NewUnsubackPacket returns a Unsuback instance by the given FixHeader and io.Reader.
NewUnsubscribePacket returns a Unsubscribe instance by the given FixHeader and io.Reader.
NewWriter returns a new Writer.
TopicMatch returns whether the topic and topic filter is matched.
TotalBytes returns how many bytes of the packet.
No description provided by the author
ValidateID takes a PacketType and a property name and returns a boolean indicating if that property is valid for that PacketType.
ValidTopicFilter 验证主题过滤器是否合法
ValidTopicFilter returns whether the bytes is a valid topic filter.
ValidTopicName returns whether the bytes is a valid non-shared topic filter.[MQTT-4.7.1-1].
ValidUTF8 验证是否utf8
ValidUTF8 returns whether the given bytes is in UTF-8 form.
ValidV5Topic returns whether the given bytes is a valid MQTT V5 topic.
# Constants
Packet type.
Packet type.
Packet type.
Packet type.
Flag in the FixHeader.
Flag in the FixHeader.
Flag in the FixHeader.
Flag in the FixHeader.
The maximum packet size of a MQTT packet.
Max & min packet ID.
Max & min packet ID.
No description provided by the author
No description provided by the author
Packet type.
Packet type.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Packet type.
Packet type.
Packet type.
Packet type.
Packet type.
QoS levels & Subscribe failure.
QoS levels & Subscribe failure.
QoS levels & Subscribe failure.
Packet type.
Packet type.
Packet type.
QoS levels & Subscribe failure.
Packet type.
Packet type.
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
Error type.
ValidProperties is a map of the various properties and the PacketTypes that is valid for server to unpack.
# Structs
No description provided by the author
Connack represents the MQTT Connack packet.
Connect represents the MQTT Connect packet.
Disconnect represents the MQTT Disconnect packet.
FixHeader represents the FixHeader of the MQTT packet.
MockPacket is a mock of Packet interface.
MockPacketMockRecorder is the mock recorder for MockPacket.
Pingreq represents the MQTT Pingreq packet.
Pingresp represents the MQTT Pingresp packet.
Properties is a struct representing the all the described properties allowed by the MQTT protocol, determining the validity of a property relvative to the packettype it was received in is provided by the ValidateID function.
Puback represents the MQTT Puback packet.
Pubcomp represents the MQTT Pubcomp packet.
Publish represents the MQTT Publish packet.
Pubrec represents the MQTT Pubrec packet.
Pubrel represents the MQTT Pubrel packet.
Reader is used to read data from bufio.Reader and create MQTT packet instance.
ReadWriter warps Reader and Writer.
Suback represents the MQTT Suback packet.
SubOptions is the subscription option of subscriptions.
Subscribe represents the MQTT Subscribe packet.
Topic represents the MQTT Topic.
Unsuback represents the MQTT Unsuback packet.
Unsubscribe represents the MQTT Unsubscribe packet.
No description provided by the author
Writer is used to encode MQTT packet into bytes and write it to bufio.Writer.
# Interfaces
Packet defines the interface for structs intended to hold decoded MQTT packets, either from being read or before being written.
# Type aliases
PacketID is the type of packet identifier.
No description provided by the author
No description provided by the author
MQTT Version.