Documentation
¶
Overview ¶
Package registry provides functionality for loading and managing registry entries
Package registry provides schema-based validation using the toolhive library
Index ¶
- type Builder
- type Loader
- func (l *Loader) GetEntries() map[string]*types.RegistryEntry
- func (l *Loader) GetSortedEntries() []*types.RegistryEntry
- func (l *Loader) LoadAll() error
- func (l *Loader) LoadEntry(path string) (*types.RegistryEntry, error)
- func (l *Loader) LoadEntryWithName(path string, name string) (*types.RegistryEntry, error)
- type OfficialRegistry
- type SchemaValidator
- func (v *SchemaValidator) ValidateComplete(entry *types.RegistryEntry, name string) error
- func (v *SchemaValidator) ValidateEntry(entry *types.RegistryEntry, name string) error
- func (*SchemaValidator) ValidateEntryFields(entry *types.RegistryEntry, name string) error
- func (*SchemaValidator) ValidateRegistry(reg *toolhiveRegistry.Registry) error
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 ¶
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 ¶
ValidateAgainstSchema validates the built registry against the toolhive schema
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader handles loading registry entries from YAML files
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) 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 ¶
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