Documentation
¶
Index ¶
- type Client
- func (c *Client) Close() error
- func (c *Client) Publish(topic string, data []byte, opts ...ClientOpt) (int, error)
- func (c *Client) PublishJSON(topic string, data interface{}, opts ...ClientOpt) (int, error)
- func (c *Client) String() string
- func (c *Client) Subscribe(topics string, opts ...ClientOpt) (int, error)
- func (c *Client) Unsubscribe(topics string) (int, error)
- func (c *Client) Version() string
- type ClientOpt
- type Config
- func (c Config) WithCallback(fn EventFunc) Config
- func (c Config) WithClientId(v string) Config
- func (c Config) WithCredentials(user, password string) Config
- func (c Config) WithHost(v string) Config
- func (c Config) WithKeepalive(d time.Duration) Config
- func (c Config) WithTLS(capath, certpath, keypath string, verify bool) Config
- func (c Config) WithTrace(fn TraceFunc) Config
- type Event
- type EventFunc
- type TraceFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
func NewWithConfig ¶
New client connection with additional configuration
func (*Client) PublishJSON ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func NewConfigWithBroker ¶
Create a new empty configuration
func (Config) WithCallback ¶
func (Config) WithClientId ¶
func (Config) WithCredentials ¶
type Event ¶
func NewConnect ¶
func NewDisconnect ¶
func NewPublish ¶
func NewSubscribe ¶
func NewUnsubscribe ¶
Click to show internal directories.
Click to hide internal directories.