mqtt

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2021 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dynamic added in v0.28.0

func Dynamic(opts *cli.Options) error

Dynamic starts up a new GRPC client connected to the dProxy service and receives a stream of outbound replay messages which are then written to the message bus.

func Read

func Read(opts *cli.Options, md *desc.MessageDescriptor) error

Read is the entry point function for performing read operations in MQTT.

This is where we verify that the provided arguments and flag combination makes sense/are valid; this is also where we will perform our initial conn.

func Relay added in v0.4.0

func Relay(opts *cli.Options, relayCh chan interface{}, shutdownCtx context.Context) (relay.IRelayBackend, error)

Relay sets up a new MQTT relayer

func Write

func Write(opts *cli.Options, md *desc.MessageDescriptor) error

Write is the entry point function for performing write operations in MQTT.

This is where we verify that the passed args and flags combo makes sense, attempt to establish a connection, parse protobuf before finally attempting to perform the write.

Types

type MQTT

type MQTT struct {
	Options *cli.Options
	Client  pahomqtt.Client
	MsgDesc *desc.MessageDescriptor
	// contains filtered or unexported fields
}

func (*MQTT) Read

func (m *MQTT) Read() error

func (*MQTT) Write

func (m *MQTT) Write(value []byte) error

Write is a wrapper for amqp Publish method. We wrap it so that we can mock it in tests, add logging etc.

type Relayer added in v0.24.0

type Relayer struct {
	Client  pahomqtt.Client
	Options *cli.Options
	RelayCh chan interface{}

	Looper      *director.FreeLooper
	ShutdownCtx context.Context
	// contains filtered or unexported fields
}

func (*Relayer) Relay added in v0.24.0

func (r *Relayer) Relay() error

Relay reads messages from MQTT and sends them to RelayCh which is then read by relay.Run()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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