Versions in this module Expand all Collapse all v0 v0.2.0 Feb 26, 2020 Changes in this version type Client + func (c *Client) SubscribeMultiple(ctx context.Context, subscriptions map[string]QOS) error v0.1.0 Nov 1, 2019 Changes in this version + var ErrMinimumOneServer = errors.New("mqtt: at least one server needs to be specified") + type Client struct + Options ClientOptions + func NewClient(options ClientOptions) (*Client, error) + func (c *Client) Connect(ctx context.Context) error + func (c *Client) DisconnectImmediately() + func (c *Client) Handle(topic string, handler MessageHandler) Route + func (c *Client) Listen(topic string) (chan Message, Route) + func (c *Client) Publish(ctx context.Context, topic string, payload []byte, qos QOS, ...) error + func (c *Client) PublishJSON(ctx context.Context, topic string, payload interface{}, qos QOS, ...) error + func (c *Client) PublishString(ctx context.Context, topic string, payload string, qos QOS, ...) error + func (c *Client) Subscribe(ctx context.Context, topic string, qos QOS) error + func (c *Client) Unsubscribe(ctx context.Context, topic string) error + type ClientOptions struct + AutoReconnect bool + ClientID string + Password string + Servers []string + Username string + type Message struct + func (m *Message) Acknowledge() + func (m *Message) IsDuplicate() bool + func (m *Message) Payload() []byte + func (m *Message) PayloadJSON(v interface{}) error + func (m *Message) PayloadString() string + func (m *Message) QOS() QOS + func (m *Message) Topic() string + func (m *Message) TopicVars() []string + type MessageHandler func(Message) + type PublishOption int + const Retain + type QOS byte + const AtLeastOnce + const AtMostOnce + const ExactlyOnce + type Route struct + func (r *Route) Stop()