client

package
v0.0.0-...-0446ca0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Closed  chan struct{}
	Message chan *message.Publish

	ServerInfo *ServerInfo
	// contains filtered or unexported fields
}

func NewClient

func NewClient(u string) *Client

func (*Client) Connect

func (c *Client) Connect(ctx context.Context, options ...ClientOption) error

func (*Client) Disconnect

func (c *Client) Disconnect()

func (*Client) Publish

func (c *Client) Publish(topic string, body []byte, opts ...ClientOption) error

func (*Client) Subscribe

func (c *Client) Subscribe(topic string, qos message.QoSLevel) error

type ClientOption

type ClientOption struct {
	// contains filtered or unexported fields
}

func WithBasicAuth

func WithBasicAuth(user, password string) ClientOption

func WithLoginAuth

func WithLoginAuth(user, password string) ClientOption

func WithQoS

func WithQoS(qos message.QoSLevel) ClientOption

func WithRetain

func WithRetain() ClientOption

func WithWill

func WithWill(qos message.QoSLevel, retain bool, topic, payload string, property *message.WillProperty) ClientOption

type ConnectionOption

type ConnectionOption = message.ConnectProperty

type ServerInfo

type ServerInfo = message.ConnAckProperty

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL