mqtt_bridge

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

README

MQTT BRIDGE Plugin

Documentation

Index

Constants

View Source
const (
	// Name ...
	Name = "mqtt_bridge"
	// FuncEntityAction ...
	FuncEntityAction = "entityAction"

	Version = "0.0.1"
)
View Source
const (
	DirectionIn   = Direction("in")
	DirectionOut  = Direction("out")
	DirectionBoth = Direction("both")
)
View Source
const (
	AttrConnected = "connected"
	AttrOffline   = "offline"

	AttrKeepAlive      = "keepAlive"
	AttrPingTimeout    = "pingTimeout"
	AttrBroker         = "broker"
	AttrClientID       = "clientID"
	AttrConnectTimeout = "connectTimeout"
	AttrCleanSession   = "cleanSession"
	AttrUsername       = "username"
	AttrPassword       = "password"
	AttrQos            = "qos"
	AttrDirection      = "direction"
	AttrTopics         = "topics"
)

Variables

Functions

func New

func New() supervisor.Pluggable

New ...

func NewSettings

func NewSettings() m.Attributes

NewSettings ...

func NewStates

func NewStates() (states map[string]supervisor.ActorState)

NewStates ...

Types

type Actor

type Actor struct {
	supervisor.BaseActor
	// contains filtered or unexported fields
}

Actor ...

func NewActor

func NewActor(entity *m.Entity,
	service supervisor.Service) (actor *Actor)

NewActor ...

func (*Actor) Destroy

func (e *Actor) Destroy()

func (*Actor) SetState

func (e *Actor) SetState(params supervisor.EntityStateParams) error

SetState ...

func (*Actor) Spawn

func (e *Actor) Spawn()

Spawn ...

type Config

type Config struct {
	KeepAlive      int
	PingTimeout    int
	Broker         string
	ClientID       string
	ConnectTimeout int
	CleanSession   bool
	Username       string
	Password       string
	Qos            byte
	Direction      Direction
	Topics         []string
}

Config ...

type Direction

type Direction string

type MqttBridge

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

func NewMqttBridge

func NewMqttBridge(cfg *Config, server mqtt.MqttServ, actor *Actor) (bridge *MqttBridge, err error)

func (*MqttBridge) Shutdown

func (m *MqttBridge) Shutdown(ctx context.Context) (err error)

func (*MqttBridge) Start

func (m *MqttBridge) Start(ctx context.Context) (err error)

Jump to

Keyboard shortcuts

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