Documentation
¶
Index ¶
- func AddResolver(key string, res command.Resolver) error
- func GetCLIOptions() ([]kong.Option, error)
- func HasResolver(key string) bool
- func RegisterCommand[T any](cmd command.Commander[T], runnerOpts ...runner.Option) (dispatcher.Subscription, error)
- func RegisterQuery[T any, R any](qry command.Querier[T, R], runnerOpts ...runner.Option) (dispatcher.Subscription, error)
- func SetCronRegister(fn func(opts command.HandlerConfig, handler any) error)
- func SetRPCRegister(fn func(opts command.RPCConfig, handler any, meta command.CommandMeta) error)
- func Start(_ context.Context) error
- func Stop(_ context.Context) error
- func WithTestRegistry(fn func())
- type CronScheduler
- type RuntimeContainer
- func (r *RuntimeContainer) AddResolver(key string, res command.Resolver) error
- func (r *RuntimeContainer) Dependencies() RuntimeDependencies
- func (r *RuntimeContainer) HasResolver(key string) bool
- func (r *RuntimeContainer) RegisterCommand(cmd any) error
- func (r *RuntimeContainer) RegisterQuery(qry any) error
- func (r *RuntimeContainer) Registry() *command.Registry
- func (r *RuntimeContainer) Start(_ context.Context) error
- func (r *RuntimeContainer) Stop(_ context.Context) error
- type RuntimeDependencies
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCLIOptions ¶
func HasResolver ¶ added in v0.11.0
func RegisterCommand ¶
func RegisterCommand[T any](cmd command.Commander[T], runnerOpts ...runner.Option) (dispatcher.Subscription, error)
func RegisterQuery ¶
func RegisterQuery[T any, R any](qry command.Querier[T, R], runnerOpts ...runner.Option) (dispatcher.Subscription, error)
func SetCronRegister ¶
func SetCronRegister(fn func(opts command.HandlerConfig, handler any) error)
func SetRPCRegister ¶ added in v0.15.0
func WithTestRegistry ¶
func WithTestRegistry(fn func())
Types ¶
type CronScheduler ¶ added in v0.15.0
type CronScheduler interface {
AddHandler(opts command.HandlerConfig, handler any) (cron.Subscription, error)
}
CronScheduler is the minimum cron dependency needed for runtime composition.
type RuntimeContainer ¶ added in v0.15.0
type RuntimeContainer struct {
// contains filtered or unexported fields
}
RuntimeContainer is an instance-first registry composition container.
func NewRuntimeContainer ¶ added in v0.15.0
func NewRuntimeContainer(deps RuntimeDependencies) *RuntimeContainer
NewRuntimeContainer builds a runtime with explicit dependencies.
func (*RuntimeContainer) AddResolver ¶ added in v0.15.0
func (r *RuntimeContainer) AddResolver(key string, res command.Resolver) error
AddResolver adds a resolver to the backing registry.
func (*RuntimeContainer) Dependencies ¶ added in v0.15.0
func (r *RuntimeContainer) Dependencies() RuntimeDependencies
Dependencies returns a copy of runtime dependencies.
func (*RuntimeContainer) HasResolver ¶ added in v0.15.0
func (r *RuntimeContainer) HasResolver(key string) bool
HasResolver reports resolver registration state.
func (*RuntimeContainer) RegisterCommand ¶ added in v0.15.0
func (r *RuntimeContainer) RegisterCommand(cmd any) error
RegisterCommand registers command in injected dispatcher hooks (optional) and registry.
func (*RuntimeContainer) RegisterQuery ¶ added in v0.15.0
func (r *RuntimeContainer) RegisterQuery(qry any) error
RegisterQuery registers query in injected dispatcher hooks (optional) and registry.
func (*RuntimeContainer) Registry ¶ added in v0.15.0
func (r *RuntimeContainer) Registry() *command.Registry
Registry returns the backing command registry instance.
type RuntimeDependencies ¶ added in v0.15.0
type RuntimeDependencies struct {
Registry *command.Registry
Dispatcher any
Router *router.Mux
Scheduler CronScheduler
Orchestrator any
RunnerDefaults []runner.Option
CronRegister func(opts command.HandlerConfig, handler any) error
RPCRegister func(opts command.RPCConfig, handler any, meta command.CommandMeta) error
SubscribeCommand func(cmd any, opts ...runner.Option) (dispatcher.Subscription, error)
SubscribeQuery func(qry any, opts ...runner.Option) (dispatcher.Subscription, error)
}
RuntimeDependencies captures explicit runtime wiring dependencies.