nodes

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOutputReference added in v0.32.0

func GetOutputReference[G any](result ExecutionRecorder, output Output[G]) *G

func GetOutputValue added in v0.32.0

func GetOutputValue[G any](result ExecutionRecorder, output Output[G]) G

func GetOutputValues added in v0.32.0

func GetOutputValues[G any](recorder ExecutionRecorder, output []Output[G]) []G

func TryGetOutputReference added in v0.32.0

func TryGetOutputReference[G any](result ExecutionRecorder, output Output[G], fallback *G) *G

func TryGetOutputValue added in v0.17.0

func TryGetOutputValue[G any](result ExecutionRecorder, output Output[G], fallback G) G

Types

type ArrayValueInputPort added in v0.23.0

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

type ConstOutput added in v0.25.0

type ConstOutput[T any] struct {
	Ref             Node
	Val             T
	PortName        string
	PortDescription string
}

func (ConstOutput[T]) Description added in v0.25.0

func (co ConstOutput[T]) Description() string

func (ConstOutput[T]) Name added in v0.25.0

func (co ConstOutput[T]) Name() string

func (ConstOutput[T]) Node added in v0.25.0

func (co ConstOutput[T]) Node() Node

func (ConstOutput[T]) Type added in v0.25.0

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

func (ConstOutput[T]) Value added in v0.25.0

func (co ConstOutput[T]) Value() T

func (ConstOutput[T]) Version added in v0.25.0

func (ConstOutput[T]) Version() int

type Describable added in v0.21.0

type Describable interface {
	Description() string
}

type ExecutionRecorder added in v0.32.0

type ExecutionRecorder interface {
	CaptureTiming(title string, timing time.Duration)
	CaptureError(err error)
}

type ExecutionReport added in v0.32.0

type ExecutionReport struct {
	Errors    []string       `json:"errors,omitempty"`   // Any errors that occurred during execution
	Logs      []string       `json:"logs,omitempty"`     // Log messages produced
	TotalTime time.Duration  `json:"totalTime"`          // Total time taken to compute the output
	SelfTime  *time.Duration `json:"selfTime,omitempty"` // Time spent within the node itself, not counting waiting on other outputs
	Steps     []StepTiming   `json:"steps,omitempty"`    // Detailed timing of sub-operations, all sub operation times should result in TotalTime - SelfTime
}

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 ObservableExecution added in v0.32.0

type ObservableExecution interface {
	ExecutionReport() ExecutionReport
}

ObservableOutput represents an output whose execution report can be inspected.

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 StepTiming added in v0.32.0

type StepTiming struct {
	Label    string        `json:"label,omitempty"` // Descriptive name for this step
	Duration time.Duration `json:"duration"`        // Time taken by this step
	Steps    []StepTiming  `json:"steps,omitempty"` // Detailed timing of sub-operations
}

StepTiming represents the duration of a labeled sub-operation within an execution.

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]) CaptureError added in v0.32.0

func (so *StructOutput[T]) CaptureError(err error)

func (*StructOutput[T]) CaptureTiming added in v0.32.0

func (so *StructOutput[T]) CaptureTiming(title string, timing time.Duration)

func (StructOutput[T]) Description added in v0.25.0

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

func (StructOutput[T]) ExecutionReport added in v0.32.0

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

The report of executing the output function

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)

Set the result of the output

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 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