Documentation
¶
Overview ¶
Package registry provides indexed, read-only access to parsed GoCell project metadata (cells, slices, contracts).
Package registry provides in-memory registries for Cell and Contract instances, used by kernel/assembly to look up dependencies at init time and by kernel/governance for cross-reference validation.
Lifecycle: registries are populated once during assembly bootstrap (phase2 in runtime/bootstrap) and remain immutable afterward. Lookups are concurrent-safe by virtue of immutability, not via locking.
Index ¶
- type CellRegistry
- type ContractRegistry
- func (r *ContractRegistry) AllIDs() []string
- func (r *ContractRegistry) ByKind(kind string) []*metadata.ContractMeta
- func (r *ContractRegistry) ByOwner(cellID string) []*metadata.ContractMeta
- func (r *ContractRegistry) Consumers(contractID string) ([]string, error)
- func (r *ContractRegistry) Count() int
- func (r *ContractRegistry) Get(id string) *metadata.ContractMeta
- func (r *ContractRegistry) Provider(contractID string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CellRegistry ¶
type CellRegistry struct {
// contains filtered or unexported fields
}
CellRegistry provides indexed access to cells and their slices.
func NewCellRegistry ¶
func NewCellRegistry(project *metadata.ProjectMeta) *CellRegistry
NewCellRegistry builds a registry from parsed project metadata.
func (*CellRegistry) AllIDs ¶
func (r *CellRegistry) AllIDs() []string
AllIDs returns all cell IDs sorted alphabetically.
func (*CellRegistry) Count ¶
func (r *CellRegistry) Count() int
Count returns the total number of cells.
type ContractRegistry ¶
type ContractRegistry struct {
// contains filtered or unexported fields
}
ContractRegistry provides indexed access to contracts.
func NewContractRegistry ¶
func NewContractRegistry(project *metadata.ProjectMeta) *ContractRegistry
NewContractRegistry builds a registry from parsed project metadata.
func (*ContractRegistry) AllIDs ¶
func (r *ContractRegistry) AllIDs() []string
AllIDs returns all contract IDs sorted alphabetically.
func (*ContractRegistry) ByKind ¶
func (r *ContractRegistry) ByKind(kind string) []*metadata.ContractMeta
ByKind returns deep copies of all contracts of the given kind.
func (*ContractRegistry) ByOwner ¶
func (r *ContractRegistry) ByOwner(cellID string) []*metadata.ContractMeta
ByOwner returns deep copies of all contracts owned by the given cell.
func (*ContractRegistry) Consumers ¶
func (r *ContractRegistry) Consumers(contractID string) ([]string, error)
Consumers returns the consumer actor IDs for a contract. For http: clients, event: subscribers, command: invokers, projection: readers, grpc: clients, webhook: receivers (the inbound consumer cells; matches governance contractConsumers/consumerFieldName). Dispatchers are outbound senders, not consumers, so they are not returned here. saga has no consumer endpoints (the orchestrating provider drives the workflow) and returns nil. Returns an error if the contract is not found or the kind is unknown.
func (*ContractRegistry) Count ¶
func (r *ContractRegistry) Count() int
Count returns the total number of contracts.
func (*ContractRegistry) Get ¶
func (r *ContractRegistry) Get(id string) *metadata.ContractMeta
Get returns a deep copy of a contract by ID, or nil if not found.
func (*ContractRegistry) Provider ¶
func (r *ContractRegistry) Provider(contractID string) (string, error)
Provider returns the provider actor ID for a contract. For http: server, event: publisher, command: handler, projection: provider, webhook: ownerCell, grpc: server, saga: server (matches metadata.ContractMeta.ProviderEndpoint). Returns an error if the contract is not found or the kind is unknown.