component-composition

command
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Component Composition

A noderun workflow demonstrating reusable components — one definition, two expanded instances:

inject "alpha" → component:def-wrap → debug
inject "beta"  → component:def-wrap → debug

def-wrap (definition): in → function "[" + payload + "]" → out

Things to notice:

  • A node of type "component" carries the definition: in/out port arrays wiring into an internal nodes/edges graph, an optional env parameter list, and a name. Definition nodes are templates — they never execute.
  • An instance node's type is component:<defId>. At deploy, ExpandComponents replaces each instance with a namespaced copy of the internal graph (inst-a gets inst-a/wrap) and grafts the outside edges onto the port endpoints.
  • Each instance is fully independent — its own nodes, state, node context. Definitions can declare env vars that instances override via their env data, including env-typed reads of the process environment when engine.AllowOSEnv is on.
  • Expansion is bounded: nested components are allowed, but total expanded nodes are capped (maxExpandedNodes) and recursion is rejected.

Run from the noderun module root:

go run ./examples/component-composition

Expected output (branch ordering may vary):

[alpha]
[beta]

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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