Documentation
¶
Overview ¶
Package registry holds flow and node registrations. See design docs/plans/2026-06-24-flow-engine-design.md §18.1.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DuplicateRegistrationError ¶
DuplicateRegistrationError reports an Add of a (GraphID, Version) that is already registered (§18.1). Per CLAUDE.md every package-level failure is a concrete typed error so callers can errors.As to inspect it; it names both the GraphID and the Version so an operator can identify the offending registration from a log line. A different version of the same GraphID is NOT a duplicate.
func (*DuplicateRegistrationError) Error ¶
func (e *DuplicateRegistrationError) Error() string
Error names the duplicated (GraphID, Version) registration.
type GraphManifest ¶
GraphManifest is the per-GraphID advertisement of the versions this registry serves (§18.1): the data §18.3's GET /v1/graphs returns. Versions is sorted ascending for a stable, deterministic listing.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is the concurrency-safe, in-process resolver from (GraphID, GraphVersion) to a flow.RunnerHandle (§18.1). It is a pure lookup table: it does not execute graphs or route work. Construct one with New.
func (*Registry) Add ¶
func (r *Registry) Add(h flow.RunnerHandle) error
Add registers h under its (GraphID, GraphVersion). Keying on BOTH lets multiple versions of one graph coexist, so adding a different version of an already- registered GraphID succeeds. A duplicate — the SAME (id, version) already registered — is rejected with a typed *DuplicateRegistrationError (fail loudly, not a silent overwrite). It is concurrency-safe (write lock).
func (*Registry) Keys ¶
func (r *Registry) Keys() []flow.GraphVersionKey
Keys returns one flow.GraphVersionKey per registered (GraphID, GraphVersion), in deterministic order (sorted by GraphID bytes then version), so flow.Serve can Consume EXACTLY the keys this registry serves (§18.5/§18.6 — registration is implicit via Consume). It is concurrency-safe (read lock) and returns a freshly allocated, non-nil slice (empty when nothing is registered) so a caller cannot mutate the registry's internal state. With Resolve, this satisfies flow.Resolver structurally — no adapter needed.
func (*Registry) Manifest ¶
func (r *Registry) Manifest() []GraphManifest
Manifest returns one GraphManifest per distinct GraphID, each with its sorted list of served versions (§18.1, §18.3). The slice order across GraphIDs is not specified (a map iteration), but each entry's Versions is sorted. It is concurrency-safe (read lock) and returns freshly allocated slices so a caller cannot mutate the registry's internal state.