Versions in this module Expand all Collapse all v11 v11.1.0 Aug 10, 2024 v11.0.0 Jul 24, 2024 Changes in this version + const LevelFatal + const LevelTrace + var ErrInvalidServer = errors.New("invalid server") + var ErrInvalidTopicPrefix = errors.New("invalid topic prefix") + var ErrNoConnection = errors.New("no MQTT connection") + var ErrNoPrefs = errors.New("no preferences provided") + type Client struct + func NewClient(ctx context.Context, prefs Preferences, subscriptions []*Subscription, ...) (*Client, error) + func (c *Client) Publish(ctx context.Context, msgs ...*Msg) error + func (c *Client) Unpublish(ctx context.Context, msgs ...*Msg) error + type Device interface + Configuration func() []*Msg + Name func() string + States func() []*Msg + Subscriptions func() []*Subscription + type Msg struct + Message json.RawMessage + QOS byte + Retained bool + Topic string + func NewMsg(topic string, msg json.RawMessage) *Msg + func (m *Msg) Retain() *Msg + type Preferences interface + Password func() string + Server func() string + TopicPrefix func() string + User func() string + type Subscription struct + Callback func(p *paho.Publish) + Topic string Other modules containing this package github.com/joshuar/go-hass-anything github.com/joshuar/go-hass-anything/v10 github.com/joshuar/go-hass-anything/v12 github.com/joshuar/go-hass-anything/v2 github.com/joshuar/go-hass-anything/v3 github.com/joshuar/go-hass-anything/v4 github.com/joshuar/go-hass-anything/v5 github.com/joshuar/go-hass-anything/v6 github.com/joshuar/go-hass-anything/v7 github.com/joshuar/go-hass-anything/v8 github.com/joshuar/go-hass-anything/v9