Documentation
¶
Overview ¶
Package payloadbuiltins aggregates first-party payload registrations into a single bootstrap call. Mirrors how componentregistry aggregates first-party component factories.
Why this lives outside payloadregistry: payloadregistry must remain a leaf package with no upward deps (the cycle that beta.16 broke). This aggregator imports every package that owns first-party payloads, so it has to live above them in the import graph.
Examples are NOT included — they're domain-specific and registered separately by binaries that load them (typically cmd/e2e-semstreams). Federation payloads are domain-parameterized and called explicitly by products that use them (semsource, semquery, etc.).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTestDecoder ¶
NewTestDecoder builds a registry populated with all first-party payloads and returns a *message.Decoder bound to it. Convenience for tests that decode wire bytes directly without going through a component.
Equivalent to: message.NewDecoder(NewTestRegistry(tb)).
func NewTestRegistry ¶
func NewTestRegistry(tb testing.TB) *payloadregistry.Registry
NewTestRegistry builds a *payloadregistry.Registry populated with all first-party payloads via Register(reg). Convenience for tests that need to wire deps.PayloadRegistry on a component under test.
The testing.TB argument forces this to compile only in test files — production code physically cannot reach this helper. Mirrors httptest.NewRecorder placement.
For tests that want a tighter subset, build a registry directly via payloadregistry.NewWithSubset.
func Register ¶
func Register(reg *payloadregistry.Registry) error
Register registers all first-party payload types with the supplied registry. Aggregates errors via errors.Join so a misconfigured deployment sees every collision on a single boot.
Called from cmd/semstreams/main.go and cmd/e2e-semstreams/main.go after the registry is constructed but before component lifecycle begins. Downstream binaries (semspec, semdragon) may call this and then layer their own custom payload registrations on top via reg.Register(...).
Types ¶
This section is empty.