package
0.10.1
Repository: https://github.com/koron/go-mqtt.git
Documentation: pkg.go.dev

# README

MQTT packet

Available packets

  • packet.Connect
  • packet.ConnACK
  • packet.Disconnect
  • packet.PingReq
  • packet.PingResp
  • packet.Subscribe
  • packet.SubACK
  • packet.Unsubscribe
  • packet.UnsubACK
  • packet.Publish
  • packet.PubACK
  • packet.PubRec
  • packet.PubRel
  • packet.PubComp

# Functions

Decode decodes a Packet from datagram.
Split splits datagram of a Packet from Reader.
SplitDecode splits datagram from Reader and decode it as a Packet.

# Constants

ConnectAccept is "Connect Accepted".
ConnectBadUserNameOrPassword is "Connection Refused: bad user name or password".
ConnectIdentifierRejected is "Connection Refused: identifier rejected".
ConnectNotAuthorized is "Connection Refused: not authorized".
ConnectServerUnavailable is "Connection Refused: server unavailable".
ConnectUnacceptableProtocolVersion is "Connection Refused: unacceptable protocol version".
QAtLeastOnce represents "acknowledged delivery" (>=1).
QAtMostOnce represents "fire and forget" (<=1).
QExactlyOnce represents "assured delivery" (=1).
QReserved is reseved.
SubscribeAtLeastOnce is "Success - Maximum QoS 1".
SubscribeAtMostOnce is "Success - Maximum QoS 0".
SubscribeExactOnce is "Success - Maximum QoS 2".
SubscribeFailure is "Failure".
TConnACK is ack for TConnect.
TConnect is request to connect.
TDisconnect is value for disconnect.
TPingReq is value for PING response.
TPingResp is value for PING response.
TPubACK is ack for TPublish for QoS1 message.
TPubComp is TPublish complete for QoS2 messages.
TPublish is publish a message.
TPubRec is TPublish received for QoS2 messages.
TPubRel is TPublish release for QoS2 messages.
TReserved is a reserved value and should be considered an invalid message type.
TReserved2 is a reserved value and should be considered an invalid message type.
TSubACK is ack for TSubscribe.
TSubscribe is value for subscribe a topic.
TUnsubACK is ack for TUnsubscribe.
TUnsubscribe is value for unsubscrbie a topic.

# Structs

ConnACK represents CONNACK packet.
Connect represents CONNECT packet.
Disconnect represents DISCONNECT packet.
PingReq represents PINGREQ packet.
PingResp represents PINGRESP packet.
PubACK represents PUBACK packet.
PubComp represents PUBCOMP packet.
Publish represents PUBLISH packet.
PubRec represents PUBREC packet.
PubRel represents PUBREL packet.
SubACK represents SUBACK packet.
Subscribe represents SUBSRIBE packet.
Topic represents topics to subscribe.
UnsubACK represents UNSUBACK packet.
Unsubscribe represents UNSUBSCRIBE packet.

# Interfaces

Packet represents common I/F for packats.
Reader declares stream which can be decoded as Packets.

# Type aliases

ConnectReturnCode is used in ConnACK.
ID is identifier for packet/message.
QoS represents QoS levels of MQTT.
SubscribeResult represents result of subscribe to topic.
Type is the type representing the MQTT packet's message type.