functions

package
v0.0.0-...-ab5431c Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFunctionUpdatedMessage

func NewFunctionUpdatedMessage(f *fnct) messaging.TopicMessage

Types

type Function

type Function interface {
	ID() string
	Name() string

	Handle(context.Context, *events.MessageAccepted, messaging.MsgContext) error
	History(context.Context, string, int) ([]LogValue, error)
}

type LogValue

type LogValue struct {
	Value     float64   `json:"v"`
	Timestamp time.Time `json:"ts"`
}

type Registry

type Registry interface {
	Find(ctx context.Context, matchers ...RegistryMatcherFunc) ([]Function, error)
	Get(ctx context.Context, functionID string) (Function, error)
}

func NewRegistry

func NewRegistry(ctx context.Context, input io.Reader, storage database.Storage) (Registry, error)

type RegistryMatcherFunc

type RegistryMatcherFunc func(r *reg) []Function

func MatchAll

func MatchAll() RegistryMatcherFunc

func MatchSensor

func MatchSensor(sensorId string) RegistryMatcherFunc

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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