Versions in this module Expand all Collapse all v1 v1.0.0 Nov 5, 2026 Changes in this version + const BrokerHost + func BrokerURL(t Transport, host string) string + func Publish(ctx context.Context, topic string, payload any, qos byte, retain bool, ...) error + func TopicMatches(filter, topic string) bool + func TopicPrefix() string + type Client struct + func Connect(ctx context.Context, opts *Options) (*Client, error) + func (c *Client) Close() + func (c *Client) IsConnected() bool + func (c *Client) Messages(ctx context.Context, filter string, qos byte) (<-chan Message, error) + func (c *Client) Paho() paho.Client + func (c *Client) Publish(ctx context.Context, topic string, payload any, qos byte, retain bool) error + func (c *Client) Subscribe(ctx context.Context, filter string, qos byte, handler func(Message)) (unsubscribe func() error, err error) + func (c *Client) URL() string + func (c *Client) WaitForMessage(ctx context.Context, filter string) (Message, error) + type Message struct + Payload []byte + QoS byte + Received time.Time + Retained bool + Topic string + func (m Message) JSON(v any) error + func (m Message) String() string + type Options struct + ClientID string + Configure func(*paho.ClientOptions) + Host string + KeepAlive time.Duration + Password string + Port int + Timeout time.Duration + Transport Transport + Username string + type TestResult struct + Connect time.Duration + Err error + OK bool + RoundTrip time.Duration + URL string + func Test(ctx context.Context, opts *Options) TestResult + type Transport string + const TCP + const TLS + const WS + const WSS