Documentation ¶
Index ¶
- Constants
- Variables
- func Code(v, c byte) byte
- type Auth
- type Connack
- type Connect
- type Disconnect
- type Error
- type FixHeader
- type Packet
- type Pingreq
- type Pingresp
- type Properties
- type Puback
- type Pubcomp
- type Publish
- type Pubrec
- type Pubrel
- type Suback
- type Subscribe
- type Subscription
- type Unsuback
- type Unsubscribe
Constants ¶
View Source
const ( CONNECT = iota + 1 CONNACK PUBLISH PUBACK PUBREC PUBREL PUBCOMP SUBSCRIBE SUBACK UNSUBSCRIBE UNSUBACK PINGREQ PINGRESP DISCONNECT AUTH )
Packet type
View Source
const ( V31 = iota + 3 V311 V5 )
MQTT Version
View Source
const ( Qos0 byte = iota Qos1 Qos2 )
MQTT Qos
View Source
const ( Accepted = 0x00 RefusedBadProtocolVersion = 0x01 RefusedIDRejected = 0x02 RefusedBadUsernameOrPassword = 0x04 RefusedNotAuthorised = 0x05 Failure = 0x80 )
V3 reason code
View Source
const ( Success = 0x00 NormalDisconnection = 0x00 GrantedQoS0 = 0x00 GrantedQoS1 = 0x01 GrantedQoS2 = 0x02 DisconnectWithWillMessage = 0x04 NotMatchingSubscribers = 0x10 NoSubscriptionExisted = 0x11 ContinueAuthentication = 0x18 ReAuthenticate = 0x19 UnspecifiedError = 0x80 MalformedPacket = 0x81 ProtocolError = 0x82 ImplementationSpecificError = 0x83 UnsupportedProtocolVersion = 0x84 ClientIdentifierNotValid = 0x85 BadUserNameOrPassword = 0x86 NotAuthorized = 0x87 ServerBusy = 0x89 Banned = 0x8A BadAuthMethod = 0x8C KeepAliveTimeout = 0x8D SessionTakenOver = 0x8E TopicFilterInvalid = 0x8F TopicNameInvalid = 0x90 PacketIDInUse = 0x91 PacketIDNotFound = 0x92 RecvMaxExceeded = 0x93 TopicAliasInvalid = 0x94 PacketTooLarge = 0x95 MessageRateTooHigh = 0x96 QuotaExceeded = 0x97 AdminAction = 0x98 PayloadFormatInvalid = 0x99 RetainNotSupported = 0x9A QoSNotSupported = 0x9B UseAnotherServer = 0x9C ServerMoved = 0x9D ConnectionRateExceeded = 0x9F MaxConnectTime = 0xA0 SubIDNotSupported = 0xA1 WildcardSubNotSupported = 0xA2 )
V5 reason code
View Source
const ( PayloadFormat = 0x01 MessageExpiry = 0x02 ContentType = 0x03 ResponseTopic = 0x08 CorrelationData = 0x09 SubscriptionIdentifier = 0x0B SessionExpiryInterval = 0x11 AssignedClientID = 0x12 ServerKeepAlive = 0x13 AuthMethod = 0x15 AuthData = 0x16 RequestProblemInfo = 0x17 WillDelayInterval = 0x18 RequestResponseInfo = 0x19 ResponseInfo = 0x1A ServerReference = 0x1C ReasonString = 0x1F ReceiveMaximum = 0x21 TopicAliasMaximum = 0x22 TopicAlias = 0x23 MaximumQoS = 0x24 RetainAvailable = 0x25 User = 0x26 MaximumPacketSize = 0x27 WildcardSubAvailable = 0x28 SubIDAvailable = 0x29 )
Properties
Variables ¶
View Source
var ( ErrMalformed = &Error{Code: MalformedPacket} ErrProtocol = &Error{Code: ProtocolError} )
Functions ¶
Types ¶
type Auth ¶
type Auth struct { FixHeader *FixHeader ReasonCode byte Properties *Properties }
type Connack ¶
type Connack struct { FixHeader *FixHeader Version byte SessionPresent bool ReasonCode byte Properties *Properties }
Connack Packet
type Connect ¶
type Connect struct { FixHeader *FixHeader // Variable Header Protocol string Version byte // Connect Flags UsernameFlag bool PasswordFlag bool WillRetain bool WillQos byte WillFlag bool CleanStart bool Reserved bool KeepAlive uint16 Properties *Properties // Payload ClientID string WillProperties *Properties WillTopic string WillMsg string Username string Password string }
Connect Packet
type Disconnect ¶
type Disconnect struct { FixHeader *FixHeader Version byte ReasonCode byte Properties *Properties }
Disconnect Packet
type Properties ¶
type Properties struct { PayloadFormat *byte MessageExpiry *uint32 ContentType string ResponseTopic string CorrelationData string SubscriptionIdentifier []uint32 SessionExpiryInterval *uint32 AssignedClientID string ServerKeepAlive *uint16 AuthMethod string AuthData string RequestProblemInfo *byte WillDelayInterval *uint32 RequestResponseInfo *byte ResponseInfo string ServerReference string ReasonString string ReceiveMaximum *uint16 TopicAliasMaximum *uint16 TopicAlias *uint16 MaximumQoS *byte RetainAvailable *byte User map[string]string MaximumPacketSize *uint32 WildcardSubAvailable *byte SubIDAvailable *byte }
type Puback ¶
type Puback struct { FixHeader *FixHeader Version byte PacketID uint16 ReasonCode byte Properties *Properties }
Puback Packet
type Pubcomp ¶
type Pubcomp struct { FixHeader *FixHeader Version byte PacketID uint16 ReasonCode byte Properties *Properties }
Pubcomp Packet
type Publish ¶
type Pubrec ¶
type Pubrec struct { FixHeader *FixHeader Version byte PacketID uint16 ReasonCode byte Properties *Properties }
Pubrec Packet
type Pubrel ¶
type Pubrel struct { FixHeader *FixHeader Version byte PacketID uint16 ReasonCode byte Properties *Properties }
Pubrel Packet
type Suback ¶
type Suback struct { FixHeader *FixHeader Version byte PacketID uint16 Properties *Properties Payload []byte }
Suback Packet
type Subscribe ¶
type Subscribe struct { FixHeader *FixHeader Version byte PacketID uint16 Subscriptions []Subscription Properties *Properties }
type Subscription ¶
type Unsuback ¶
type Unsuback struct { FixHeader *FixHeader Version byte PacketID uint16 Properties *Properties Payload []byte }
Unsuback Packet
type Unsubscribe ¶
type Unsubscribe struct { FixHeader *FixHeader Version byte PacketID uint16 Topics []string Properties *Properties }
Click to show internal directories.
Click to hide internal directories.