ports

package
v0.0.0-...-e670723 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommunicationPort

type CommunicationPort interface {
	Open() error
	Read(buffer []byte) (int, error)
	Write(payload []byte) (int, error)
	Close() error
}

type Database

type Database interface {
	InsertDiscoveryRecord(discovery string, prefix string, fields []DiscoveryField) error
	InsertRecord(measurement map[string]interface{}) error
}

type DatabaseWithListener

type DatabaseWithListener interface {
	Database
	Subscribe(topic string, callback mqtt.MessageHandler)
}

type Device

type Device interface {
	Name() string
	GetDiscoveryFields() []DiscoveryField
	Query() (map[string]interface{}, error)
}

type DiscoveryField

type DiscoveryField struct {
	Name   string
	Factor string
	Unit   string
}

support MQTT Discovery

Jump to

Keyboard shortcuts

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