Documentation ¶
Index ¶
Constants ¶
const ( TypeOfConnect = uint8(iota + 1) TypeOfConnack TypeOfPublish TypeOfPuback TypeOfPubrec TypeOfPubrel TypeOfPubcomp TypeOfSubscribe TypeOfSuback TypeOfUnsubscribe TypeOfUnsuback TypeOfPingreq TypeOfPingresp TypeOfDisconnect )
MQTT message types
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connack ¶
type Connack struct {
ReturnCode uint8
}
Connack represents an MQTT connack packet. 0x00 connection accepted 0x01 refused: unacceptable proto version 0x02 refused: identifier rejected 0x03 refused server unavailiable 0x04 bad user or password 0x05 not authorized
type Connect ¶
type Connect struct { ProtoName []byte Version uint8 UsernameFlag bool PasswordFlag bool WillRetainFlag bool WillQOS uint8 WillFlag bool CleanSeshFlag bool KeepAlive uint16 ClientID []byte WillTopic []byte WillMessage []byte Username []byte Password []byte }
Connect represents an MQTT connect packet.
type Disconnect ¶
type Disconnect struct { }
Disconnect is to signal you want to cease communications with the server
type Pingreq ¶
type Pingreq struct { }
Pingreq is a keepalive
type Pingresp ¶
type Pingresp struct { }
Pingresp is for saying "hey, the server is alive"
type Puback ¶
type Puback struct {
MessageID uint16
}
Puback is sent for QOS level one to verify the receipt of a publish Qoth the spec: "A PUBACK message is sent by a server in response to a PUBLISH message from a publishing client, and by a subscriber in response to a PUBLISH message from the server."
type Pubcomp ¶
type Pubcomp struct {
MessageID uint16
}
Pubcomp is for saying is in response to a pubrel sent by the publisher the final member of the QOS2 flow. both sides have said "hey, we did it!"
type Publish ¶
type Publish struct { Header *StaticHeader Topic []byte MessageID uint16 Payload []byte }
Publish represents an MQTT publish packet.
type Pubrec ¶
type Pubrec struct {
MessageID uint16
}
Pubrec is for verifying the receipt of a publish Qoth the spec:"It is the second message of the QoS level 2 protocol flow. A PUBREC message is sent by the server in response to a PUBLISH message from a publishing client, or by a subscriber in response to a PUBLISH message from the server."
type Pubrel ¶
type Pubrel struct { MessageID uint16 //QOS1 Header *StaticHeader }
Pubrel is a response to pubrec from either the client or server.
type StaticHeader ¶
StaticHeader as defined in http://public.dhe.ibm.com/software/dw/webservices/ws-mqtt/mqtt-v3r1.html#fixed-header
type Suback ¶
Suback is to say "hey, you got it buddy. I will send you messages that fit this pattern"
type Subscribe ¶
type Subscribe struct { Header *StaticHeader MessageID uint16 Subscriptions []TopicQOSTuple }
Subscribe tells the server which topics the client would like to subscribe to
type TopicQOSTuple ¶
TopicQOSTuple is a struct for pairing the Qos and topic together for the QOS' pairs in unsubscribe and subscribe
type Unsuback ¶
type Unsuback struct {
MessageID uint16
}
Unsuback is to unsubscribe as suback is to subscribe
type Unsubscribe ¶
type Unsubscribe struct { Header *StaticHeader MessageID uint16 Topics []TopicQOSTuple }
Unsubscribe is the message to send if you don't want to subscribe to a topic anymore