mqtt

package
v1.0.31 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: Unlicense Imports: 9 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 interface {
	Publish(topic string, payload interface{}) error
	Subscribe(ctx context.Context, topic string) (rxgo.Observable, error)
	SubscribeReturnMessage(ctx context.Context, topic string) (rxgo.Observable, error)
	IsConnected() bool
	Close()
}

func NewClient

func NewClient(opts ClientOptions) (Client, error)

type ClientOptions

type ClientOptions struct {
	Server    string // tcp://host:port
	TLSConfig *ClientOptions_TLSConfig
	ClientID  string
}

type ClientOptions_TLSConfig

type ClientOptions_TLSConfig struct {
	Cert   []byte
	Key    []byte
	RootCa []byte
}

func GetTLSConfigFromFile

func GetTLSConfigFromFile(certFile, keyFile, rootCaFile string) *ClientOptions_TLSConfig

type Message added in v1.0.10

type Message struct {
	Topic   string
	Payload []byte
}

Jump to

Keyboard shortcuts

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