Documentation
¶
Overview ¶
Package compose carries the project-supplied part of a host process.
A project names one Go package as its compose package in the dist and CLI compiler configs. That package exports Compose() *compose.Composition, which the generated main calls once per process. The composition owns any state its factories and commands share, such as process-wide brokers, so Bldr wires project controllers without knowing their types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddFactoriesFunc ¶
type AddFactoriesFunc = func(b bus.Bus) []controller.Factory
AddFactoriesFunc constructs controller factories bound to a host bus.
type Composition ¶
type Composition struct {
// Factories construct the project's controller factories on each host bus.
Factories []AddFactoriesFunc
// Commands build the project's CLI commands.
Commands []cli_entrypoint.BuildCommandsFunc
}
Composition is the project-supplied part of a native host process.
func (*Composition) AddFactories ¶
func (c *Composition) AddFactories(b bus.Bus, sr *static.Resolver)
AddFactories adds the composition's factories to a host bus resolver. A nil composition adds nothing.