Documentation
¶
Index ¶
- type Entry
- type Registry
- func (r *Registry) Count() int
- func (r *Registry) DependencyGraph(id string) ([]string, error)
- func (r *Registry) Discover(ctx context.Context, role string) []contracts.ModuleInfo
- func (r *Registry) FindByCapability(cap string) []contracts.ModuleEntry
- func (r *Registry) FindByRole(role string) []contracts.ModuleEntry
- func (r *Registry) Get(id string) (*Entry, error)
- func (r *Registry) List() []*Entry
- func (r *Registry) ListAll() []contracts.ModuleEntry
- func (r *Registry) ListByCapability(cap string) []*Entry
- func (r *Registry) ListByRole(role string) []*Entry
- func (r *Registry) Register(module contracts.Module, deps []string) error
- func (r *Registry) Resolve(id string) (contracts.ModuleEntry, error)
- func (r *Registry) ResolveDeps(id string) ([]string, error)
- func (r *Registry) SetHealth(id string, err error) error
- func (r *Registry) SetState(id string, state contracts.ModuleState) error
- func (r *Registry) StartupOrder() ([]string, error)
- func (r *Registry) SupportsCapability(moduleID, cap string) bool
- func (r *Registry) Unregister(id string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct {
Module contracts.Module
Info contracts.ModuleInfo
State contracts.ModuleState
Health error
Deps []string
}
Entry holds a registered module and its metadata.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is the core module registry. It stores modules indexed by ID, maintains a capability index for fast lookup, and provides the contracts.Registry interface for module discovery.
func (*Registry) DependencyGraph ¶ added in v0.4.0
DependencyGraph returns all module IDs that list the given module in their DependsOn. Useful for understanding the impact of stopping or removing a module.
func (*Registry) FindByCapability ¶
func (r *Registry) FindByCapability(cap string) []contracts.ModuleEntry
func (*Registry) FindByRole ¶ added in v0.4.0
func (r *Registry) FindByRole(role string) []contracts.ModuleEntry
func (*Registry) ListAll ¶
func (r *Registry) ListAll() []contracts.ModuleEntry
func (*Registry) ListByCapability ¶
func (*Registry) ListByRole ¶ added in v0.4.0
func (*Registry) Register ¶
Register adds a module to the registry. Returns an error if the module ID is empty, the module name is empty, or the ID is already registered. Core performs no interface validation — that responsibility belongs to consumer modules, contract repos, and the marketplace compatibility checker.
func (*Registry) SetState ¶
func (r *Registry) SetState(id string, state contracts.ModuleState) error
func (*Registry) StartupOrder ¶ added in v0.4.0
StartupOrder returns all module IDs in dependency-respecting order. Modules in DependsOn appear before the module that depends on them. Returns an error if a dependency cycle is detected.
func (*Registry) SupportsCapability ¶
func (*Registry) Unregister ¶
Unregister removes a module and cleans up its capability index entries.