mqtt

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadLoginOrPassword = fmt.Errorf("bad login or password")

Functions

This section is empty.

Types

type Authenticator

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

func NewAuthenticator

func NewAuthenticator(adaptors *adaptors.Adaptors) *Authenticator

func (*Authenticator) Authenticate

func (a *Authenticator) Authenticate(login string, pass interface{}) (err error)

func (Authenticator) LocalClientUuid

func (a Authenticator) LocalClientUuid() string

func (Authenticator) Name

func (a Authenticator) Name() string

func (*Authenticator) Register

func (a *Authenticator) Register()

type Client

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

func NewClient

func NewClient(uri, topic string,
	authenticator *Authenticator) (client *Client, err error)

func (*Client) Connect

func (c *Client) Connect() (err error)

func (*Client) Disconnect

func (c *Client) Disconnect()

Disconnects from the server

func (*Client) Publish

func (c *Client) Publish(v []byte) (err error)

func (*Client) Subscribe

func (c *Client) Subscribe(topic string, onComplete service.OnCompleteFunc, onPublish service.OnPublishFunc) (err error)

type Mqtt

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

func NewMqtt

func NewMqtt(cfg *MqttConfig,
	graceful *graceful_service.GracefulService,
	authenticator *Authenticator) (mqtt *Mqtt)

func (*Mqtt) NewClient

func (m *Mqtt) NewClient(topic string) (c *Client, err error)

func (*Mqtt) Shutdown

func (m *Mqtt) Shutdown()

type MqttConfig

type MqttConfig struct {
	SrvKeepAlive        int
	SrvConnectTimeout   int
	SrvSessionsProvider string
	SrvTopicsProvider   string
	SrvPort             int
}

func NewMqttConfig

func NewMqttConfig(cfg *config.AppConfig) *MqttConfig

Jump to

Keyboard shortcuts

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