Documentation
¶
Index ¶
- func Register(factory *node.Factory, deps Deps)
- type Deps
- type ScriptNode
- func (n *ScriptNode) Config() map[string]any
- func (n *ScriptNode) ExecuteBoard(ctx graph.ExecutionContext, board *graph.Board) error
- func (n *ScriptNode) ID() string
- func (n *ScriptNode) InputPorts() []graph.Port
- func (n *ScriptNode) OutputPorts() []graph.Port
- func (n *ScriptNode) SetConfig(c map[string]any)
- func (n *ScriptNode) Type() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶ added in v0.2.3
Register binds the built-in script-backed node builders ("script", every type in scripts.BuiltinTypes(), plus a fallback that resolves type.js from deps.ScriptFS) onto factory.
deps.ScriptRuntime is required at build time for any node this function registers; nodes whose type also needs a shell bridge will additionally require deps.CommandRunner. Missing deps are reported as a build-time validation error from Factory.Build.
Types ¶
type Deps ¶ added in v0.2.3
type Deps struct {
ScriptRuntime script.Runtime
ScriptFS fs.FS
Workspace workspace.Workspace
CommandRunner workspace.CommandRunner
}
Deps captures the build-time dependencies needed to instantiate a scriptnode. ScriptRuntime is required; the rest are optional.
type ScriptNode ¶
type ScriptNode struct {
// contains filtered or unexported fields
}
ScriptNode is a script-based graph node that delegates execution to a language-agnostic script.Runtime.
func New ¶
func New(id, nodeType, scriptSrc string, config map[string]any, rt script.Runtime, extras ...bindings.BindingFunc) *ScriptNode
New creates a ScriptNode with the given script and configuration.
func (*ScriptNode) Config ¶
func (n *ScriptNode) Config() map[string]any
func (*ScriptNode) ExecuteBoard ¶
func (n *ScriptNode) ExecuteBoard(ctx graph.ExecutionContext, board *graph.Board) error
ExecuteBoard runs the script with board, expr, host, stream, and runtime bindings.
func (*ScriptNode) ID ¶
func (n *ScriptNode) ID() string
func (*ScriptNode) InputPorts ¶
func (n *ScriptNode) InputPorts() []graph.Port
func (*ScriptNode) OutputPorts ¶
func (n *ScriptNode) OutputPorts() []graph.Port
func (*ScriptNode) SetConfig ¶
func (n *ScriptNode) SetConfig(c map[string]any)
func (*ScriptNode) Type ¶
func (n *ScriptNode) Type() string