registry

package
v0.0.0-...-14a6114 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package registry provides functionality for loading and managing registry entries

Package registry provides schema-based validation using the toolhive library

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 builds the final registry JSON from loaded entries

func NewBuilder

func NewBuilder(loader *Loader) *Builder

NewBuilder creates a new registry builder

func (*Builder) Build

func (b *Builder) Build() (*toolhiveRegistry.Registry, error)

Build creates the final registry structure compatible with toolhive

func (*Builder) ValidateAgainstSchema

func (b *Builder) ValidateAgainstSchema() error

ValidateAgainstSchema validates the built registry against the toolhive schema

func (*Builder) WriteJSON

func (b *Builder) WriteJSON(path string) error

WriteJSON writes the registry to a JSON file

type Loader

type Loader struct {
	// contains filtered or unexported fields
}

Loader handles loading registry entries from YAML files

func NewLoader

func NewLoader(registryPath string) *Loader

NewLoader creates a new registry loader

func (*Loader) GetEntries

func (l *Loader) GetEntries() map[string]*types.RegistryEntry

GetEntries returns all loaded entries

func (*Loader) GetSortedEntries

func (l *Loader) GetSortedEntries() []*types.RegistryEntry

GetSortedEntries returns entries sorted by name

func (*Loader) LoadAll

func (l *Loader) LoadAll() error

LoadAll loads all registry entries from the registry directory

func (*Loader) LoadEntry

func (l *Loader) LoadEntry(path string) (*types.RegistryEntry, error)

LoadEntry loads a single registry entry from a YAML file without validation Use LoadEntryWithName for validation with proper naming

func (*Loader) LoadEntryWithName

func (l *Loader) LoadEntryWithName(path string, name string) (*types.RegistryEntry, error)

LoadEntryWithName loads a single registry entry from a YAML file with validation

type OfficialRegistry

type OfficialRegistry struct {
	// contains filtered or unexported fields
}

OfficialRegistry handles building and writing the toolhive MCP registry based on the official server format

func NewOfficialRegistry

func NewOfficialRegistry(loader *Loader) *OfficialRegistry

NewOfficialRegistry creates a new instance of the official registry

func (*OfficialRegistry) ValidateAgainstSchema

func (or *OfficialRegistry) ValidateAgainstSchema() error

ValidateAgainstSchema validates the built registry against the schema

func (*OfficialRegistry) WriteJSON

func (or *OfficialRegistry) WriteJSON(path string) error

WriteJSON builds the official MCP registry and writes it to the specified path Individual entries and the complete registry are validated before writing - generation fails if validation fails

type SchemaValidator

type SchemaValidator struct{}

SchemaValidator provides comprehensive schema-based validation using the toolhive library

func NewSchemaValidator

func NewSchemaValidator() *SchemaValidator

NewSchemaValidator creates a new schema validator

func (*SchemaValidator) ValidateComplete

func (v *SchemaValidator) ValidateComplete(entry *types.RegistryEntry, name string) error

ValidateComplete performs both schema validation and field validation

func (*SchemaValidator) ValidateEntry

func (v *SchemaValidator) ValidateEntry(entry *types.RegistryEntry, name string) error

ValidateEntry validates a single registry entry using the toolhive schema

func (*SchemaValidator) ValidateEntryFields

func (*SchemaValidator) ValidateEntryFields(entry *types.RegistryEntry, name string) error

ValidateEntryFields performs additional field-level validation beyond schema validation

func (*SchemaValidator) ValidateRegistry

func (*SchemaValidator) ValidateRegistry(reg *toolhiveRegistry.Registry) error

ValidateRegistry validates a complete registry using the toolhive schema

Jump to

Keyboard shortcuts

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