client

package
v0.0.0-...-b72f9b1 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// DataCodec is the parsed dataSchema.avsc
	DataCodec *goavro.Codec = avro.CreateSchema(dataSchema)
)

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a struct containing client relevant data

func NewClient

func NewClient(target string, nats *nats.Conn) *Client

NewClient creates a new client for talking to `mqtt-bridge`

func (*Client) PublishOnMqttTopic

func (c *Client) PublishOnMqttTopic(topic string, payload []byte) error

PublishOnMqttTopic is used to to send to a specific MQTT topic.

func (*Client) RegisterMqttTopic

func (c *Client) RegisterMqttTopic(topic string) (schema.RegisterSubResponseType, error)

RegisterMqttTopic is used to let a client register to a specific MQTT topic. This functions returns a nats subject the client can subscribe to in order to read the forwarded message.

func (*Client) RequestReply

func (c *Client) RequestReply(topic string, payload []byte, timeout int32) ([]byte, error)

RequestReply is used to to send to a specific MQTT topic.

func (*Client) UnregisterNatsSubject

func (c *Client) UnregisterNatsSubject(subject string) error

UnregisterNatsSubject is used to unregister a client from a specific nats subject previously registered using 'RegisterMqttTopic'.

Jump to

Keyboard shortcuts

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