Documentation
¶
Overview ¶
Package registry provides functionality for loading server.json files and building the aggregate upstream registry.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder assembles an UpstreamRegistry from loaded ServerJSON entries.
func NewBuilder ¶
NewBuilder creates a new Builder backed by the given Loader.
func (*Builder) Build ¶
func (b *Builder) Build() *thvregistry.UpstreamRegistry
Build creates the UpstreamRegistry structure from loaded entries. Servers are ordered by directory name for deterministic output.
func (*Builder) ValidateAgainstSchema ¶
ValidateAgainstSchema builds the registry and validates it without writing.
type LegacyBuilder ¶
type LegacyBuilder struct {
// contains filtered or unexported fields
}
LegacyBuilder assembles a legacy toolhive Registry from loaded ServerJSON entries. It converts each ServerJSON back to ImageMetadata or RemoteServerMetadata using the converters package.
func NewLegacyBuilder ¶
func NewLegacyBuilder(loader *Loader) *LegacyBuilder
NewLegacyBuilder creates a new LegacyBuilder backed by the given Loader.
func (*LegacyBuilder) Build ¶
func (b *LegacyBuilder) Build() (*toolhiveRegistry.Registry, error)
Build creates the legacy toolhive Registry structure from loaded ServerJSON entries. Entries are processed in sorted order for deterministic output.
func (*LegacyBuilder) ValidateAgainstSchema ¶
func (b *LegacyBuilder) ValidateAgainstSchema() error
ValidateAgainstSchema builds the legacy registry and validates it without writing.
func (*LegacyBuilder) WriteJSON ¶
func (b *LegacyBuilder) WriteJSON(path string) error
WriteJSON builds the legacy registry, validates it, and writes JSON to the given path.
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader walks a servers directory and loads server.json files into memory.
func (*Loader) GetEntries ¶
func (l *Loader) GetEntries() map[string]upstream.ServerJSON
GetEntries returns all loaded server.json entries keyed by directory name.
func (*Loader) GetSortedNames ¶
GetSortedNames returns directory names in sorted order for deterministic output.