package
0.5.1
Repository: https://github.com/lab5e/lmqtt.git
Documentation: pkg.go.dev

# Functions

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 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.
IsVersion3X returns true if the version byte is 3.x.
IsVersion5 returns true if the version byte is 5.x.
NewAuthPacket creates a new auth packet.
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 返回topic和topic filter是否 TopicMatch returns whether the topic and topic filter is matched.
TotalBytes returns how many bytes of the packet.
ValidateCode validates the code.
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 types.
Packet types.
Packet types.
Packet types.
Flag in the FixHeader.
Flag in the FixHeader.
Flag in the FixHeader.
Flag in the FixHeader.
MaximumSize is the maximum packet size of a MQTT packet.
Max & min packet ID.
Max & min packet ID.
Payload format constants.
Payload format constants.
Packet types.
Packet types.
Payload format bytes.
Payload format bytes.
Payload format bytes.
Payload format bytes.
Payload format bytes.
Payload format bytes.
Payload format bytes.
Payload format bytes.
Payload format bytes.
Payload format bytes.
Payload format bytes.
Payload format bytes.
Payload format bytes.
Payload format bytes.
Payload format bytes.
Payload format bytes.
Payload format bytes.
Payload format bytes.
Payload format bytes.
Payload format bytes.
Payload format bytes.
Payload format bytes.
Payload format bytes.
Payload format bytes.
Payload format bytes.
Payload format bytes.
Payload format bytes.
Packet types.
Packet types.
Packet types.
Packet types.
Packet types.
QoS levels & Subscribe failure.
QoS levels & Subscribe failure.
QoS levels & Subscribe failure.
Packet types.
Packet types.
Packet types.
QoS levels & Subscribe failure.
Packet types.
Packet types.
Version numbers for MQTT.
Version numbers for MQTT.
Version numbers for MQTT.

# Variables

Error type.
ValidProperties is a map of the various properties and the PacketTypes that is valid for server to unpack.

# Structs

Auth is the AUTH packet (https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901217).
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.
UserProperty is user-defined properties.
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.
PayloadFormat is the payload formats supported.
QoS is the Quality of Service setting in MQTT.
Version is the MQTT Version.