Documentation
¶
Overview ¶
Package index owns the immutable bootstrap map from protocol identities to authored component sources. Building the map does not load Go types, compile execution plans, open connectors, or create a paths.yaml file.
Index ¶
- Variables
- type Builder
- type Config
- type Entry
- type Gate
- type Generation
- type Lease
- func (l *Lease) Close()
- func (l *Lease) GenerationID() uint64
- func (l *Lease) LoadComponent(ctx context.Context, key spec.Key) (*Loaded, error)
- func (l *Lease) LoadMCP(ctx context.Context, identity MCPIdentity, gate Gate) (*Loaded, error)
- func (l *Lease) LoadRoute(ctx context.Context, method, path string, gate Gate) (*Loaded, map[string]string, error)
- func (l *Lease) MaterializeAll(ctx context.Context) ([]*Loaded, error)
- func (l *Lease) Snapshot() *Snapshot
- type Loaded
- type MCPIdentity
- type MaterializeFunc
- type Materializer
- type Registry
- type Resolver
- type Snapshot
- func (s *Snapshot) Component(key spec.Key) (*Entry, bool)
- func (s *Snapshot) Entries() []*Entry
- func (s *Snapshot) MCP(identity MCPIdentity) (*Entry, bool)
- func (s *Snapshot) Route(method, path string) (*Entry, *spec.Route, map[string]string, bool)
- func (s *Snapshot) Transform(apply func(*spec.Component)) (*Snapshot, error)
- type Source
- type SourceKind
Constants ¶
This section is empty.
Variables ¶
var ( ErrClosed = errors.New("bootstrap component generation is closed") ErrStaleSource = errors.New("bootstrap component source changed after indexing") )
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct {
Component *spec.Component
// Warmup indicates that the component has root or child warmup declarations
// discoverable during indexed bootstrap, before executable readers exist.
Warmup bool
// Owner identifies the authored component that materializes this entry when
// the entry is a derived report component.
Owner spec.Key
Sources []Source
Fingerprint string
}
Entry is the immutable routing metadata and source authority for one component. Contract fields and executable plans are intentionally absent.
type Gate ¶
Gate runs against indexed route metadata before component materialization. Protocol adapters use it for route/API authorization; canonical binding and handler authorization continue against the loaded registration.
type Generation ¶
type Lease ¶
type Lease struct {
// contains filtered or unexported fields
}
func (*Lease) GenerationID ¶
func (*Lease) LoadComponent ¶
func (*Lease) MaterializeAll ¶
MaterializeAll is the explicit opt-in for schema/documentation consumers that require full contracts. Normal bootstrap and metadata listing use the index and never call this method.
type Loaded ¶
type Loaded struct {
Registration *registry.RegisteredComponent
// Related registrations are materialized coherently with the primary (for
// example report-generated subcomponents) and become exact-key load hits in
// this generation.
Related []*registry.RegisteredComponent
Release func(context.Context) error
}
Loaded is one generation-owned executable component and its cleanup hook. Release must close only resources owned by this materialization.
type MCPIdentity ¶
type MCPIdentity struct {
Kind spec.MCPExposureKind
Name string
}
type MaterializeFunc ¶
func (MaterializeFunc) Materialize ¶
type Materializer ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry atomically publishes complete bootstrap index generations. A Lease pins one generation for the full request, including lazy dependency loads.
func (*Registry) Publish ¶
func (r *Registry) Publish(snapshot *Snapshot, materializer Materializer) (*Generation, error)
type Resolver ¶
Resolver lets a materializer load component dependencies from the same immutable generation. Cycles fail before waiting on an existing load.
type Snapshot ¶
type Snapshot struct {
Fingerprint string
SelectionIdentity string
// contains filtered or unexported fields
}
Snapshot is a deterministic, immutable bootstrap index. Public accessors detach metadata so callers cannot mutate the published generation.
type Source ¶
type Source struct {
Kind SourceKind
Path string
Dir string
PackagePath string
Fingerprint string
}
Source identifies one selected file and its bootstrap-time content digest.
type SourceKind ¶
type SourceKind string
const ( SourceGo SourceKind = "go" SourceDQL SourceKind = "dql" SourceResource SourceKind = "resource" )