mqtt

package
v0.0.0-...-54e2124 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type Client

type Client interface {
	GetTopic(string) (*Topic, bool)
	IsConnected() bool
	Subscribe(string) *Topic
	Unsubscribe(string)
	Dispose()
}

func NewClient

func NewClient(o Options) (Client, error)

type Message

type Message struct {
	Timestamp time.Time
	Value     []byte
}

type Options

type Options struct {
	URI      string `json:"uri"`
	Username string `json:"username"`
	Password string `json:"password"`
}

type Topic

type Topic struct {
	Path     string `json:"topic"`
	Interval time.Duration
	Messages []Message
	// contains filtered or unexported fields
}

func (*Topic) Key

func (t *Topic) Key() string

func (*Topic) ToDataFrame

func (t *Topic) ToDataFrame() (*data.Frame, error)

type TopicMap

type TopicMap struct {
	sync.Map
}

func (*TopicMap) AddMessage

func (tm *TopicMap) AddMessage(path string, message Message)

func (*TopicMap) Delete

func (tm *TopicMap) Delete(path string)

func (*TopicMap) Load

func (tm *TopicMap) Load(path string) (*Topic, bool)

func (*TopicMap) Store

func (tm *TopicMap) Store(t *Topic)

Jump to

Keyboard shortcuts

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