nodes

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(patterns []string) string

Types

type Alertable

type Alertable interface {
	Alert(version int, state NodeState)
}

type Dependent

type Dependent interface {
	Dependencies() []NodeDependency
}

type Difference

type Difference[T vector.Number] struct {
	StructData[T]

	A NodeOutput[T]
	B NodeOutput[T]
}

============================================================================

func (*Difference[T]) Out

func (cn *Difference[T]) Out() NodeOutput[T]

func (Difference[T]) Process

func (cn Difference[T]) Process() (T, error)

type Divide

type Divide[T vector.Number] struct {
	StructData[T]

	Dividend NodeOutput[T]
	Divisor  NodeOutput[T]
}

func (*Divide[T]) Out

func (cn *Divide[T]) Out() NodeOutput[T]

func (Divide[T]) Process

func (cn Divide[T]) Process() (T, error)

type IStructData

type IStructData[T any] interface {
	// contains filtered or unexported methods
}

type Named

type Named interface {
	Name() string
}

type Node

type Node interface {
	Versioned
	Stateful
	Subscribable
	Dependent
}

type NodeDependency

type NodeDependency interface {
	Named
	Dependency() Node
}

type NodeOutput

type NodeOutput[T any] interface {
	ReferencesNode
	Data() T
}

type NodeState

type NodeState int
const (
	Stale NodeState = iota
	Processed
	Error
)

type ReferencesNode

type ReferencesNode interface {
	Node() Node
}

type StateData

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

func (StateData) State

func (s StateData) State() NodeState

type Stateful

type Stateful interface {
	State() NodeState
}

type StructData

type StructData[T any] struct {
	// contains filtered or unexported fields
}

type StructNode

type StructNode[T any] struct {
	// contains filtered or unexported fields
}

func Struct

func Struct[T any](p StructNodeProcesor[T]) *StructNode[T]

func (*StructNode[T]) AddSubscription

func (tn *StructNode[T]) AddSubscription(a Alertable)

func (*StructNode[T]) Data

func (tn *StructNode[T]) Data() T

func (StructNode[T]) Dependencies

func (tn StructNode[T]) Dependencies() []NodeDependency

func (*StructNode[T]) Name

func (tn *StructNode[T]) Name() string

func (StructNode[T]) Outdated

func (tn StructNode[T]) Outdated() bool

func (*StructNode[T]) State

func (tn *StructNode[T]) State() NodeState

func (StructNode[T]) Version

func (tn StructNode[T]) Version() int

type StructNodeDependency

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

func (StructNodeDependency) Dependency

func (tnd StructNodeDependency) Dependency() Node

func (StructNodeDependency) Name

func (tnd StructNodeDependency) Name() string

type StructNodeOutput

type StructNodeOutput[T any] struct {
	Definition StructNodeOutputDefinition[T]
}

func (StructNodeOutput[T]) Data

func (sno StructNodeOutput[T]) Data() T

func (StructNodeOutput[T]) Node

func (sno StructNodeOutput[T]) Node() Node

type StructNodeOutputDefinition

type StructNodeOutputDefinition[T any] interface {
	StructNodeProcesor[T]
	IStructData[T]
}

type StructNodeProcesor

type StructNodeProcesor[T any] interface {
	Process() (T, error)
}

type Subscribable

type Subscribable interface {
	AddSubscription(a Alertable)
}

type Sum

type Sum[T vector.Number] struct {
	StructData[T]

	Values []NodeOutput[T]
}

func (*Sum[T]) Out

func (cn *Sum[T]) Out() NodeOutput[T]

func (Sum[T]) Process

func (cn Sum[T]) Process() (T, error)

type TransformerNode

type TransformerNode[Tin any, Tout any] struct {
	// contains filtered or unexported fields
}

func Transformer

func Transformer[Tin any, Tout any](name string, in Tin, trasnformer func(in Tin) (Tout, error)) *TransformerNode[Tin, Tout]

func (*TransformerNode) AddSubscription

func (v *TransformerNode) AddSubscription(a Alertable)

func (TransformerNode[Tin, Tout]) Data

func (tn TransformerNode[Tin, Tout]) Data() Tout

func (TransformerNode[Tin, Tout]) Dependencies

func (tn TransformerNode[Tin, Tout]) Dependencies() []NodeDependency

func (*TransformerNode) MarkStale

func (v *TransformerNode) MarkStale()

func (*TransformerNode[Tin, Tout]) Name

func (tn *TransformerNode[Tin, Tout]) Name() string

func (*TransformerNode[Tin, Tout]) Node

func (in *TransformerNode[Tin, Tout]) Node() Node

func (TransformerNode[Tin, Tout]) Outdated

func (tn TransformerNode[Tin, Tout]) Outdated() bool

func (TransformerNode) State

func (s TransformerNode) State() NodeState

func (TransformerNode) Version

func (v TransformerNode) Version() int

type ValueNode

type ValueNode[T any] struct {
	VersionData
	// contains filtered or unexported fields
}

func FuncValue

func FuncValue[T any](f func() T) *ValueNode[T]

func Value

func Value[T any](startingValue T) *ValueNode[T]

func (*ValueNode[T]) AddSubscription

func (v *ValueNode[T]) AddSubscription(a Alertable)

func (ValueNode[T]) Data

func (in ValueNode[T]) Data() T

func (*ValueNode[T]) Dependencies

func (v *ValueNode[T]) Dependencies() []NodeDependency

func (ValueNode[T]) Name

func (in ValueNode[T]) Name() string

func (*ValueNode[T]) Node

func (in *ValueNode[T]) Node() Node

func (*ValueNode[T]) Set

func (in *ValueNode[T]) Set(value T)

func (*ValueNode[T]) State

func (v *ValueNode[T]) State() NodeState

type VersionData

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

func (*VersionData) Increment

func (v *VersionData) Increment() int

func (VersionData) Version

func (v VersionData) Version() int

type Versioned

type Versioned interface {
	Version() int
}

Directories

Path Synopsis
vectorn

Jump to

Keyboard shortcuts

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