dataflow

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SinkLog

func SinkLog(prefix string, input <-chan Value)

Types

type Drainable

type Drainable interface {
	Drain() <-chan Value
	Append(fillable Fillable) Fillable
}

something which provides values (-> a source)

type EnumRegisterStruct

type EnumRegisterStruct struct {
	RegisterStruct
	// contains filtered or unexported fields
}

func CreateEnumRegisterStruct

func CreateEnumRegisterStruct(category, name, description string, address uint16, static bool, enum map[int]string) EnumRegisterStruct

func (EnumRegisterStruct) Enum

func (r EnumRegisterStruct) Enum() map[int]string

func (EnumRegisterStruct) Type

func (EnumRegisterStruct) Unit

func (r EnumRegisterStruct) Unit() *string

type Fillable

type Fillable interface {
	Fill(input <-chan Value)
}

something which can consume values (-> a sink)

type Filter

type Filter struct {
	IncludeDevices         map[string]bool
	SkipRegisterNames      map[string]bool
	SkipRegisterCategories map[string]bool
}

type NumberRegisterStruct

type NumberRegisterStruct struct {
	RegisterStruct
	// contains filtered or unexported fields
}

func CreateNumberRegisterStruct

func CreateNumberRegisterStruct(
	category, name, description string,
	address uint16,
	static bool,
	signed bool,
	factor int,
	unit string,
) NumberRegisterStruct

func (NumberRegisterStruct) Factor

func (r NumberRegisterStruct) Factor() int

func (NumberRegisterStruct) Signed

func (r NumberRegisterStruct) Signed() bool

func (NumberRegisterStruct) Type

func (NumberRegisterStruct) Unit

func (r NumberRegisterStruct) Unit() *string

type NumericRegisterValue

type NumericRegisterValue struct {
	RegisterValue
	// contains filtered or unexported fields
}

func NewNumericRegisterValue

func NewNumericRegisterValue(deviceName string, register Register, value float64) NumericRegisterValue

func (NumericRegisterValue) Equals

func (v NumericRegisterValue) Equals(comp Value) bool

func (NumericRegisterValue) String

func (v NumericRegisterValue) String() string

func (NumericRegisterValue) Value

func (v NumericRegisterValue) Value() float64

type Pipelineable

type Pipelineable interface {
	Drainable
	Fillable
}

simething which does both (-> a pipeline stage)

type Register

type Register interface {
	Category() string
	Name() string
	Description() string
	Address() uint16
	Static() bool
	Type() RegisterType
	Unit() *string
}

type RegisterStruct

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

func (RegisterStruct) Address

func (r RegisterStruct) Address() uint16

func (RegisterStruct) Category

func (r RegisterStruct) Category() string

func (RegisterStruct) Description

func (r RegisterStruct) Description() string

func (RegisterStruct) Name

func (r RegisterStruct) Name() string

func (RegisterStruct) Static

func (r RegisterStruct) Static() bool

type RegisterType

type RegisterType int
const (
	StringRegister RegisterType = iota
	NumberRegister
	EnumRegister
)

type RegisterValue

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

func (RegisterValue) DeviceName

func (v RegisterValue) DeviceName() string

func (RegisterValue) Register

func (v RegisterValue) Register() Register

type Registers

type Registers []Register

func FilterRegisters

func FilterRegisters(input Registers, excludeFields []string, excludeCategories []string) (output Registers)

func MergeRegisters

func MergeRegisters(maps ...Registers) (output Registers)

type Source

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

func CreateSource

func CreateSource(output chan Value) *Source

func (*Source) Append

func (source *Source) Append(fillable Fillable) Fillable

func (*Source) Drain

func (source *Source) Drain() <-chan Value

type State

type State map[string]ValueMap

type Subscription

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

func (*Subscription) GetOutput

func (s *Subscription) GetOutput() <-chan Value

func (*Subscription) Shutdown

func (s *Subscription) Shutdown()

type TextRegisterStruct

type TextRegisterStruct struct {
	RegisterStruct
}

func CreateTextRegisterStruct

func CreateTextRegisterStruct(category, name, description string, address uint16, static bool) TextRegisterStruct

func (TextRegisterStruct) Type

func (TextRegisterStruct) Unit

func (r TextRegisterStruct) Unit() *string

type TextRegisterValue

type TextRegisterValue struct {
	RegisterValue
	// contains filtered or unexported fields
}

func NewTextRegisterValue

func NewTextRegisterValue(deviceName string, register Register, value string) TextRegisterValue

func (TextRegisterValue) Equals

func (v TextRegisterValue) Equals(comp Value) bool

func (TextRegisterValue) String

func (v TextRegisterValue) String() string

func (TextRegisterValue) Value

func (v TextRegisterValue) Value() string

type Value

type Value interface {
	DeviceName() string
	Register() Register
	String() string
	Equals(comp Value) bool
}

type ValueMap

type ValueMap map[string]Value

type ValueStorageInstance

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

func ValueStorageCreate

func ValueStorageCreate() (valueStorageInstance *ValueStorageInstance)

func (*ValueStorageInstance) Drain

func (instance *ValueStorageInstance) Drain() Subscription

func (*ValueStorageInstance) Fill

func (instance *ValueStorageInstance) Fill(input <-chan Value)

this is a simple fan-in routine which copies all inputs to the same NewValue channel

func (*ValueStorageInstance) GetSlice

func (instance *ValueStorageInstance) GetSlice(filter Filter) (result []Value)

func (*ValueStorageInstance) GetState

func (instance *ValueStorageInstance) GetState(filter Filter) State

func (*ValueStorageInstance) Shutdown

func (instance *ValueStorageInstance) Shutdown()

func (*ValueStorageInstance) Subscribe

func (instance *ValueStorageInstance) Subscribe(filter Filter) Subscription

Jump to

Keyboard shortcuts

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