nodes

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2025 License: MIT Imports: 5 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 Output[T], fallback T) T

Types

type ArrayValueInputPort added in v0.23.0

type ArrayValueInputPort interface {
	InputPort
	Value() []OutputPort
	Add(port OutputPort) error
	Remove(port OutputPort) error
}

type Describable added in v0.21.0

type Describable interface {
	Description() string
}

type InputPort added in v0.23.0

type InputPort interface {
	Port

	// Remove any connections to this port
	Clear()
}

type Named

type Named interface {
	Name() string
}

type Node

type Node interface {
	Outputs() map[string]OutputPort
	Inputs() map[string]InputPort
}

type NodeState

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

type Output added in v0.11.0

type Output[T any] interface {
	OutputPort
	Value() T
}

func GetNodeOutputPort added in v0.23.0

func GetNodeOutputPort[T any](node Node, portName string) Output[T]

type OutputPort added in v0.23.0

type OutputPort interface {
	Port
	Version() int
}

type Pathed added in v0.11.0

type Pathed interface {
	Path() string
}

type Port added in v0.23.0

type Port interface {

	// Node the port belongs to
	Node() Node

	// Name of the port
	Name() string
}

type SingleValueInputPort added in v0.23.0

type SingleValueInputPort interface {
	InputPort
	Value() OutputPort
	Set(port OutputPort) 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] struct {
	Data T
	// contains filtered or unexported fields
}

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

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

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

func (s *Struct[T]) Inputs() map[string]InputPort

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

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

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

func (s *Struct[T]) Outputs() map[string]OutputPort

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

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

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

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

type StructOutput added in v0.20.0

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

func NewStructOutput added in v0.23.0

func NewStructOutput[T any](val T) StructOutput[T]

func (StructOutput[T]) LogError added in v0.23.0

func (so StructOutput[T]) LogError(err error)

func (StructOutput[T]) Name added in v0.20.0

func (so StructOutput[T]) Name() string

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

func (so StructOutput[T]) Node() Node

func (*StructOutput[T]) Set added in v0.23.0

func (so *StructOutput[T]) Set(v T)

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Methods called by the actual function that builds the thing

We do this circus act where the StructOutput returned from the function isn't the StructOutput we pass around to other nodes to use. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

func (StructOutput[T]) Type added in v0.23.0

func (so StructOutput[T]) Type() string

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

func (so *StructOutput[T]) Value() T

func (StructOutput[T]) Version added in v0.23.0

func (so StructOutput[T]) Version() int

type Typed added in v0.11.0

type Typed interface {
	Type() string
}

type Value

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

func FuncValue

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

func NewValue added in v0.23.0

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

func (*Value[T]) Inputs added in v0.23.0

func (tn *Value[T]) Inputs() map[string]InputPort

func (*Value[T]) Outputs added in v0.23.0

func (tn *Value[T]) Outputs() map[string]OutputPort

func (*Value[T]) Set added in v0.23.0

func (in *Value[T]) Set(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