mqtt

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

README

MQTT Plugin

Documentation

Documentation

Index

Constants

View Source
const (
	// Name ...
	Name = "mqtt"
	// EntityMqtt ...
	EntityMqtt = string("mqtt")
)
View Source
const (
	// FuncMqttEvent ...
	FuncMqttEvent = "mqttEvent"
	// FuncEntityAction ...
	FuncEntityAction = "entityAction"
)
View Source
const (
	// AttrSubscribeTopic ...
	AttrSubscribeTopic = "subscribe_topic"
)

Variables

Functions

func New

func New() plugins.Pluggable

New ...

func NewSettings

func NewSettings() m.Attributes

NewSettings ...

Types

type Actor

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

Actor ...

func NewActor

func NewActor(entity *m.Entity,
	service plugins.Service,
	mqttClient mqtt.MqttCli) (actor *Actor, err error)

NewActor ...

func (*Actor) Destroy

func (e *Actor) Destroy()

func (*Actor) SetState

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

SetState ...

func (*Actor) Spawn

func (e *Actor) Spawn()

Spawn ...

type Message

type Message struct {
	Payload   string `json:"payload"`
	Topic     string `json:"topic"`
	Qos       uint8  `json:"qos"`
	Duplicate bool   `json:"duplicate"`

	Error    string                    `json:"error"`
	Success  bool                      `json:"success"`
	NewState plugins.EntityStateParams `json:"new_state"`
	// contains filtered or unexported fields
}

Message ...

func NewMessage

func NewMessage() (m *Message)

NewMessage ...

func (*Message) Clear

func (m *Message) Clear()

Clear ...

func (*Message) Copy

func (m *Message) Copy() (msg *Message)

Copy ...

func (*Message) GetVar

func (m *Message) GetVar(key string) (value interface{})

GetVar ...

func (*Message) Ok

func (m *Message) Ok()

Ok ...

func (*Message) SetError

func (m *Message) SetError(err string)

SetError ...

func (*Message) SetVar

func (m *Message) SetVar(key string, value interface{})

SetVar ...

func (*Message) Update

func (m *Message) Update(newMsg *Message)

Update ...

type Storage

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

Storage ...

func NewStorage

func NewStorage() Storage

NewStorage ...

func (*Storage) GetVar

func (s *Storage) GetVar(key string) (value interface{})

GetVar ...

func (*Storage) SetVar

func (s *Storage) SetVar(key string, value interface{})

SetVar ...

Jump to

Keyboard shortcuts

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