mqtttest

package
v0.0.0-test4 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(mqtt.Config) (mqtt.Client, error)

Types

type ClientCreator

type ClientCreator struct {
	Clients []*MockClient
	Configs []mqtt.Config
}

ClientCreator provides a NewClient method for creating new MockClients. All configs and clients created are recorded.

func (*ClientCreator) NewClient

func (s *ClientCreator) NewClient(c mqtt.Config) (mqtt.Client, error)

type MockClient

type MockClient struct {
	PublishData []PublishData
	// contains filtered or unexported fields
}

func (*MockClient) Connect

func (m *MockClient) Connect() error

func (*MockClient) Disconnect

func (m *MockClient) Disconnect()

func (*MockClient) Publish

func (m *MockClient) Publish(topic string, qos mqtt.QoSLevel, retained bool, message []byte) error

type PublishData

type PublishData struct {
	Topic    string
	QoS      mqtt.QoSLevel
	Retained bool
	Message  []byte
}

Jump to

Keyboard shortcuts

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