resource

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMissmatchedTypes = errors.New("missatched types")
View Source
var (
	ErrNotNumeric = errors.New("setpoint type must be int32 or float32")
)

Functions

This section is empty.

Types

type Action

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

func NewAction

func NewAction(callback func(storage *storage.Storage, events *event.Events) bool) *Action

func (*Action) Read

func (action *Action) Read() (any, error)

func (*Action) Start

func (action *Action) Start(name string, storage *storage.Storage, events *event.Events)

func (*Action) Stop

func (action *Action) Stop()

func (*Action) Write

func (action *Action) Write(value any) error

type Computed

type Computed[T storage.Supported] struct {
	// contains filtered or unexported fields
}

func NewComputed

func NewComputed[T storage.Supported](callback func(name string, storage *storage.Storage) T, dependencies []string) *Computed[T]

func (*Computed[T]) Read

func (computed *Computed[T]) Read() (any, error)

func (*Computed[T]) Start

func (computed *Computed[T]) Start(name string, storage *storage.Storage, events *event.Events)

func (*Computed[T]) Stop

func (computed *Computed[T]) Stop()

type Constant added in v0.5.0

type Constant[T storage.Supported] struct {
	// contains filtered or unexported fields
}

func NewConstant added in v0.5.0

func NewConstant[T storage.Supported](value T) *Constant[T]

func (*Constant[T]) Read added in v0.5.0

func (static *Constant[T]) Read() (any, error)

func (*Constant[T]) Start added in v0.5.0

func (static *Constant[T]) Start(name string, storage *storage.Storage, events *event.Events)

func (*Constant[T]) Stop added in v0.5.0

func (static *Constant[T]) Stop()

type Increment added in v0.4.0

type Increment[T storage.SupportedNumeric] struct {
	// contains filtered or unexported fields
}

func NewIncrement added in v0.4.0

func NewIncrement[T storage.SupportedNumeric](initial T, step T, interval time.Duration) *Increment[T]

func (*Increment[T]) Read added in v0.4.0

func (increment *Increment[T]) Read() (any, error)

func (*Increment[T]) Start added in v0.4.0

func (increment *Increment[T]) Start(name string, storage *storage.Storage, events *event.Events)

func (*Increment[T]) Stop added in v0.4.0

func (increment *Increment[T]) Stop()

type LinearFeedback added in v0.3.0

type LinearFeedback[T storage.SupportedNumeric] struct {
	// contains filtered or unexported fields
}

func NewLinearFeedback added in v0.3.0

func NewLinearFeedback[T storage.SupportedNumeric](step T, stepInterval time.Duration, setpoint string) *LinearFeedback[T]

func (*LinearFeedback[T]) Read added in v0.3.0

func (feedback *LinearFeedback[T]) Read() (any, error)

func (*LinearFeedback[T]) Start added in v0.3.0

func (feedback *LinearFeedback[T]) Start(name string, storage *storage.Storage, events *event.Events)

func (*LinearFeedback[T]) Stop added in v0.3.0

func (feedback *LinearFeedback[T]) Stop()

type Random

type Random[T storage.Supported] struct {
	// contains filtered or unexported fields
}

func NewRandom

func NewRandom[T storage.Supported](min T, max T, interval time.Duration) *Random[T]

func (*Random[T]) Read

func (random *Random[T]) Read() (any, error)

func (*Random[T]) Start

func (random *Random[T]) Start(name string, storage *storage.Storage, events *event.Events)

func (*Random[T]) Stop

func (random *Random[T]) Stop()

type SineWave

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

func NewSineWave

func NewSineWave(frequency float64, amplitude float64, offset float64, interval time.Duration) *SineWave

func (*SineWave) Read

func (sine *SineWave) Read() (any, error)

func (*SineWave) Start

func (sine *SineWave) Start(name string, storage *storage.Storage, events *event.Events)

func (*SineWave) Stop

func (sine *SineWave) Stop()

type Static added in v0.5.0

type Static[T storage.Supported] struct {
	*Constant[T]
	// contains filtered or unexported fields
}

func NewStatic added in v0.5.0

func NewStatic[T storage.Supported](value T) *Static[T]

func (*Static[T]) Read added in v0.5.0

func (static *Static[T]) Read() (any, error)

func (*Static[T]) Write added in v0.5.0

func (static *Static[T]) Write(value any) error

Jump to

Keyboard shortcuts

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