mqtt

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MqttClient MQTT.Client

Functions

func Bind

func Bind(options ...Option)

Types

type CLH

type CP

type Logger

type Logger struct {
	*zap.SugaredLogger
}

func (*Logger) Printf

func (l *Logger) Printf(format string, v ...interface{})

func (*Logger) Println

func (l *Logger) Println(v ...interface{})

type MH

type MH = MQTT.MessageHandler

type OCH

type OCH = MQTT.OnConnectHandler

type Option

type Option func(options *MQTT.ClientOptions)

func AutoReconnect

func AutoReconnect(a bool) Option

func BinaryWill

func BinaryWill(topic string, payload []byte, qos byte, retained bool) Option

func Broker

func Broker(broker string) Option

func CleanSession

func CleanSession(clean bool) Option

func ClientID

func ClientID(id string) Option

func ConnectRetry

func ConnectRetry(a bool) Option

func ConnectRetryInterval

func ConnectRetryInterval(t time.Duration) Option

func ConnectTimeout

func ConnectTimeout(t time.Duration) Option

func ConnectionLostHandler

func ConnectionLostHandler(onLost CLH) Option

func CredentialsProvider

func CredentialsProvider(p CP) Option

func DefaultPublishHandler

func DefaultPublishHandler(defaultHandler MH) Option

func DisableWill

func DisableWill() Option

func HTTPHeaders

func HTTPHeaders(h http.Header) Option

func KeepAlive

func KeepAlive(k time.Duration) Option

func LogMode

func LogMode(a bool) Option

func MaxReconnectInterval

func MaxReconnectInterval(t time.Duration) Option

func MessageChannelDepth

func MessageChannelDepth(s uint) Option

func OnConnectHandler

func OnConnectHandler(onConn OCH) Option

func OrderMatters

func OrderMatters(order bool) Option

func PingTimeout

func PingTimeout(k time.Duration) Option

func ProtocolVersion

func ProtocolVersion(pv uint) Option

func Pwd

func Pwd(pwd string) Option

func ReconnectiongHandler

func ReconnectiongHandler(rh RH) Option

func ResumeSubs

func ResumeSubs(resume bool) Option

func Store

func Store(s ST) Option

func TLSConfig

func TLSConfig(t *tls.Config) Option

func UserName

func UserName(username string) Option

func WebsocketOptions

func WebsocketOptions(w *WsOptions) Option

func Will

func Will(topic, payload string, qos byte, retained bool) Option

func WriteTimeout

func WriteTimeout(t time.Duration) Option

type RH

type ST

type ST = MQTT.Store

type WsOptions

type WsOptions = MQTT.WebsocketOptions

Jump to

Keyboard shortcuts

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