converter

package
v2.8.4 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogTopicOnce

func LogTopicOnce(converter string, input Input)

Types

type Config

type Config interface {
	Name() string
	Implementation() string
	InfluxClients() []string
	LogHandleOnce() bool
	LogDebug() bool
}

type EnumTelemetryValue

type EnumTelemetryValue struct {
	Category    string `json:"Cat"`
	Description string `json:"Desc"`
	EnumIdx     int    `json:"Idx"`
	Value       string `json:"Val"`
}

type HandleFunc

type HandleFunc func(c Config, topicMatcher TopicMatcher, input Input, outputFunc OutputFunc)

func GetHandler

func GetHandler(implementation string) (h HandleFunc, err error)

type Input

type Input interface {
	Topic() string
	Payload() []byte
}

type Output

type Output interface {
	Measurement() string
	Tags() map[string]string
	Fields() map[string]interface{}
	Time() time.Time
}

type OutputFunc

type OutputFunc func(output Output)

type TopicMatcher

type TopicMatcher interface {
	MatchDevice(messageTopic string) (device string, err error)
	GetSubscribeTopic() string
}

func CreateTopicMatcher

func CreateTopicMatcher(cfg TopicMatcherConfig) (TopicMatcher, error)

type TopicMatcherConfig

type TopicMatcherConfig interface {
	Topic() string
	Device() string
	DeviceIsDynamic() bool
}

Jump to

Keyboard shortcuts

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