client

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUIDRequired      = errors.New("uid is required")
	ErrPasswordRequired = errors.New("password is required")
	ErrHostRequired     = errors.New("host is required")
	ErrPortRequired     = errors.New("port is required")
)

Functions

This section is empty.

Types

type Client

type Client interface {
	Connected() bool
	Disconnect()
	Unsubscribe(topic string)
	Subscribe(topic string, callback mqtt.MessageHandler)
	Publish(topic string, retained bool, payload any)
}

func NewClient

func NewClient(opts ...Option) (Client, error)

type Logger

type Logger interface {
	Infof(format string, args ...any)
	Warnf(format string, args ...any)
	Errorf(format string, args ...any)
	Fatalf(format string, args ...any)
}

func NewLogger

func NewLogger(base Logger) Logger

type Option

type Option func(*client)

func AddLogger

func AddLogger(base Logger) Option

func Host

func Host(host string) Option

func Password

func Password(password string) Option

func Port

func Port(port string) Option

func UID

func UID(username string) Option

Jump to

Keyboard shortcuts

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