mqtt

package
v0.0.0-...-2b5faad Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2021 License: MIT Imports: 11 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AvailabilityTopic

func AvailabilityTopic(prefix, name string) string

func ConfigTopic

func ConfigTopic(prefix, component, name, variable string) string

func StateTopic

func StateTopic(prefix, name string) string

func TopicSafe

func TopicSafe(s string) string

func ValidateConfig

func ValidateConfig(cfg *ClientConfig) error

Types

type Client

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

func NewClient

func NewClient(cfg *ClientConfig, logger *log.Logger) (*Client, error)

func (*Client) Run

func (c *Client) Run(ctx context.Context, in chan *Msg, out chan *Msg) error

type ClientConfig

type ClientConfig struct {
	AppName              string
	Version              string
	Debug                bool
	ClientID             string
	Broker               string
	KeepAlive            int16
	ConnectRetryDelay    time.Duration
	Log                  *log.Logger
	DiscoveryTopicPrefix string
	DataTopicPrefix      string
}

type Msg

type Msg struct {
	Topic  string
	Body   interface{}
	Retain bool
}

type PubSubServer

type PubSubServer interface {
	Run(ctx context.Context, in chan *Msg, out chan *Msg) error
}

Jump to

Keyboard shortcuts

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