nodes

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TryGetOutputValue added in v0.17.0

func TryGetOutputValue[T any](output NodeOutput[T], fallback T) T

Types

type Alertable

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

type Dependent

type Dependent interface {
	Dependencies() []NodeDependency
}

type Describable added in v0.21.0

type Describable interface {
	Description() string
}

type Input added in v0.11.0

type Input struct {
	Name  string
	Type  string
	Array bool
}

type Named

type Named interface {
	Name() string
}

type Node

type Node interface {
	Versioned
	Stateful
	Dependent

	SetInput(input string, output Output)
	Outputs() []Output
	Inputs() []Input
}

type NodeDependency

type NodeDependency interface {
	Named
	Dependency() Node
	DependencyPort() string
}

type NodeOutput

type NodeOutput[T any] interface {
	NodeOutputReference
	Value() T
}

type NodeOutputReference added in v0.11.0

type NodeOutputReference interface {
	Node() Node
	Port() string
}

type NodeState

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

type Output added in v0.11.0

type Output struct {
	Type       string
	NodeOutput NodeOutputReference
}

type Pathed added in v0.11.0

type Pathed interface {
	Path() string
}

type Processor added in v0.11.0

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

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 Struct

type Struct[T any, G StructProcesor[T]] struct {
	Data G
	// contains filtered or unexported fields
}

func NewStruct added in v0.20.0

func NewStruct[T StructProcesor[G], G any](p T) *Struct[G, T]

func (*Struct[T, G]) AddSubscription added in v0.20.0

func (sn *Struct[T, G]) AddSubscription(a Alertable)

func (Struct[T, G]) Dependencies added in v0.20.0

func (sn Struct[T, G]) Dependencies() []NodeDependency

func (Struct[T, G]) Description added in v0.21.0

func (sn Struct[T, G]) Description() string

func (Struct[T, G]) Inputs added in v0.20.0

func (sn Struct[T, G]) Inputs() []Input

func (Struct[T, G]) Name added in v0.20.0

func (sn Struct[T, G]) Name() string

func (*Struct[T, G]) Node added in v0.20.0

func (sn *Struct[T, G]) Node() Node

func (*Struct[T, G]) Out added in v0.20.0

func (sn *Struct[T, G]) Out() StructOutput[T, G]

func (Struct[T, G]) Outdated added in v0.20.0

func (sn Struct[T, G]) Outdated() bool

func (*Struct[T, G]) Outputs added in v0.20.0

func (sn *Struct[T, G]) Outputs() []Output

func (Struct[T, G]) Path added in v0.20.0

func (sn Struct[T, G]) Path() string

func (*Struct[T, G]) Port added in v0.20.0

func (sn *Struct[T, G]) Port() string

func (*Struct[T, G]) SetInput added in v0.20.0

func (sn *Struct[T, G]) SetInput(input string, output Output)

func (*Struct[T, G]) State added in v0.20.0

func (sn *Struct[T, G]) State() NodeState

func (Struct[T, G]) Type added in v0.20.0

func (sn Struct[T, G]) Type() string

func (*Struct[T, G]) Value added in v0.20.0

func (sn *Struct[T, G]) Value() T

func (Struct[T, G]) Version added in v0.20.0

func (sn Struct[T, G]) Version() int

type StructDependency added in v0.20.0

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

func (StructDependency) Dependency added in v0.20.0

func (snd StructDependency) Dependency() Node

func (StructDependency) DependencyPort added in v0.20.0

func (snd StructDependency) DependencyPort() string

func (StructDependency) Name added in v0.20.0

func (snd StructDependency) Name() string

type StructOutput added in v0.20.0

type StructOutput[T any, G StructProcesor[T]] struct {
	Struct *Struct[T, G]
	Name   string
}

func (StructOutput[T, G]) Node added in v0.20.0

func (sno StructOutput[T, G]) Node() Node

func (StructOutput[T, G]) Port added in v0.20.0

func (sno StructOutput[T, G]) Port() string

func (StructOutput[T, G]) Value added in v0.20.0

func (sno StructOutput[T, G]) Value() T

type StructProcesor added in v0.20.0

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

type Subscribable

type Subscribable interface {
	AddSubscription(a Alertable)
}

type Typed added in v0.11.0

type Typed interface {
	Type() string
}

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]) Dependencies

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

func (ValueNode[T]) Inputs added in v0.11.0

func (tn ValueNode[T]) Inputs() []Input

func (ValueNode[T]) Name

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

func (*ValueNode[T]) Node

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

func (*ValueNode[T]) Out added in v0.11.0

func (in *ValueNode[T]) Out() ValueNodeOutput[T]

func (*ValueNode[T]) Outputs added in v0.11.0

func (tn *ValueNode[T]) Outputs() []Output

func (*ValueNode[T]) Port added in v0.11.0

func (in *ValueNode[T]) Port() string

func (*ValueNode[T]) Set

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

func (ValueNode[T]) SetInput added in v0.11.0

func (vn ValueNode[T]) SetInput(input string, output Output)

func (*ValueNode[T]) State

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

func (ValueNode[T]) Value added in v0.11.0

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

type ValueNodeOutput added in v0.11.0

type ValueNodeOutput[T any] struct {
	Val *ValueNode[T]
}

func (ValueNodeOutput[T]) Node added in v0.11.0

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

func (ValueNodeOutput[T]) Port added in v0.11.0

func (sno ValueNodeOutput[T]) Port() string

func (ValueNodeOutput[T]) Value added in v0.11.0

func (sno ValueNodeOutput[T]) Value() T

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

Jump to

Keyboard shortcuts

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