mqtt

package
v0.0.0-...-a461f5f Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func NewCache

func NewCache() *Cache

func (*Cache) Delete

func (c *Cache) Delete(uid types.UID) error

func (*Cache) Get

func (*Cache) Update

func (c *Cache) Update(msg *mqttv1.ResourceMessage) error

type Connection

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

func NewConnection

func NewConnection(
	log logr.Logger, opts ConnectionOptions,
) *Connection

func (*Connection) Publish

func (c *Connection) Publish(ctx context.Context, m *paho.Publish) error

func (*Connection) Start

func (c *Connection) Start(ctx context.Context) error

type ConnectionOptions

type ConnectionOptions struct {
	BrokerURLs         []string
	Topic              string
	KeepAlive          time.Duration
	ClientID           string
	Username, Password string
	OnMessage          func(m *paho.Publish)
}

type Decoder

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

Decodes MQTT messages into unstructured.Unstructured.

func NewDecoder

func NewDecoder(sink DecoderSink) *Decoder

func (*Decoder) Decode

func (d *Decoder) Decode(m *paho.Publish) error

type DecoderSink

type DecoderSink interface {
	Update(msg *mqttv1.ResourceMessage) error
	Delete(uid types.UID) error
}

type DecoderSinkList

type DecoderSinkList []DecoderSink

func (DecoderSinkList) Delete

func (l DecoderSinkList) Delete(uid types.UID) error

func (DecoderSinkList) Update

type EventClient

type EventClient struct {
	// Buffered channel of outbound messages.
	Channel chan event.GenericEvent
}

func NewEventClient

func NewEventClient() *EventClient

type EventHub

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

func NewEventHub

func NewEventHub() *EventHub

func (*EventHub) Broadcast

func (h *EventHub) Broadcast(e event.GenericEvent)

func (*EventHub) Delete

func (h *EventHub) Delete(uid types.UID) error

Decoder Sink

func (*EventHub) Register

func (h *EventHub) Register(c *EventClient)

func (*EventHub) Start

func (h *EventHub) Start(ctx context.Context) error

func (*EventHub) Unregister

func (h *EventHub) Unregister(c *EventClient)

func (*EventHub) Update

func (h *EventHub) Update(msg *mqttv1.ResourceMessage) error

Jump to

Keyboard shortcuts

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