registry

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 5 Imported by: 0

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

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.

func (*CellRegistry) Get

func (r *CellRegistry) Get(id string) *metadata.CellMeta

Get returns a deep copy of a cell by ID, or nil if not found.

func (*CellRegistry) SlicesFor

func (r *CellRegistry) SlicesFor(cellID string) []*metadata.SliceMeta

SlicesFor returns deep copies of all slices belonging to the given cell.

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL