Versions in this module Expand all Collapse all v1 v1.6.7 Feb 27, 2018 Changes in this version + const CONNACK + const CONNECT + const DELAY + const DISCONNECT + const FLUSH + const NO_DELAY + const PINGREQ + const PINGRESP + const PUBACK + const PUBCOMP + const PUBLISH + const PUBREC + const PUBREL + const Rserved + const SUBACK + const SUBSCRIBE + const UNSUBACK + const UNSUBSCRIBE + func DelayWritePack(pack *Pack, w *bufio.Writer) (err error) + func WritePack(pack *Pack, w *bufio.Writer) error + type Client struct + func NewClient(conf conf.Mqtt, recover PackRecover, r *bufio.Reader, w *bufio.Writer, ...) *Client + func (c *Client) Listen_loop() (e error) + func (c *Client) WriteMsg(topic string, body []byte) error + type Connack struct + func (c *Connack) GetReturnCode() byte + func (c *Connack) SetReturnCode(return_code byte) + type Connect struct + func (c *Connect) GetKeepAlive() int + func (c *Connect) GetPassword() *string + func (c *Connect) GetProtocol() *string + func (c *Connect) GetReturnCode() byte + func (c *Connect) GetUserName() *string + func (c *Connect) GetVersion() byte + func (c *Connect) GetWillMsg() (bool, *string, *string) + func (c *Connect) IsCleanSession() bool + type Pack struct + func GetConnAckPack(return_code byte) *Pack + func GetPingResp(qos byte, dup byte) *Pack + func GetPubAckPack(mid int) *Pack + func GetPubCOMPPack(mid int) *Pack + func GetPubPack(qos byte, dup byte, mid int, topic *string, msg []byte) *Pack + func GetPubRECPack(mid int) *Pack + func GetPubRELPack(mid int) *Pack + func GetSubAckPack(mid int) *Pack + func GetUNSubAckPack(mid int) *Pack + func ReadPack(r *bufio.Reader) (pack *Pack, err error) + func (pack *Pack) GetDup() byte + func (pack *Pack) GetQos() byte + func (pack *Pack) GetType() byte + func (pack *Pack) GetVariable() interface{} + func (pack *Pack) SetDup(dup byte) + func (pack *Pack) SetQos(qos byte) + func (pack *Pack) SetType(typ byte) + type PackQueue struct + func NewPackQueue(conf conf.Mqtt, r *bufio.Reader, w *bufio.Writer, conn network.Conn, ...) *PackQueue + func (queue *PackQueue) Close() error + func (queue *PackQueue) Flush() error + func (queue *PackQueue) ReadPackInLoop() + func (queue *PackQueue) SetAlive(alive int) error + func (queue *PackQueue) WriteDelayPack(pack *Pack) error + func (queue *PackQueue) WritePack(pack *Pack) error + type PackRecover interface + OnRecover func(*Pack) + type Puback struct + func (ack *Puback) GetMid() int + func (ack *Puback) SetMid(id int) + type Publish struct + func (pub *Publish) GetMid() int + func (pub *Publish) GetMsg() []byte + func (pub *Publish) GetTopic() *string + func (pub *Publish) SetMid(id int) + func (pub *Publish) SetMsg(msg []byte) + func (pub *Publish) SetTopic(topic *string) + type Suback struct + Qos byte + type Subscribe struct + func (sub *Subscribe) GetMid() int + func (sub *Subscribe) GetTopics() []Topics + func (sub *Subscribe) SetMid(id int) + type Topics struct + Qos byte + func (top *Topics) GetName() *string + func (top *Topics) GetQos() byte + func (top *Topics) SetQos(Qos byte) + type UNSuback struct + type UNSubscribe struct + func (sub *UNSubscribe) GetMid() int + func (sub *UNSubscribe) GetTopics() []Topics + func (sub *UNSubscribe) SetMid(id int) + type UNTopics struct + func (top *UNTopics) GetName() *string