Documentation
¶
Overview ¶
Package registry provides skill registration and discovery.
The registry is a central place to register skills and discover available tools across all registered skills.
Index ¶
- Variables
- type InMemory
- func (r *InMemory) Close() error
- func (r *InMemory) Count() int
- func (r *InMemory) Get(name string) (skill.Skill, error)
- func (r *InMemory) GetTool(fullName string) (skill.Tool, error)
- func (r *InMemory) Init(ctx context.Context) error
- func (r *InMemory) List() []skill.Skill
- func (r *InMemory) ListTools() []skill.Tool
- func (r *InMemory) Register(s skill.Skill) error
- func (r *InMemory) Unregister(name string) error
- type Registry
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSkillExists = errors.New("skill already registered")
ErrSkillExists is returned when attempting to register a skill that already exists.
View Source
var ErrSkillNotFound = errors.New("skill not found")
ErrSkillNotFound is returned when a skill is not found in the registry.
Functions ¶
This section is empty.
Types ¶
type InMemory ¶
type InMemory struct {
// contains filtered or unexported fields
}
InMemory is a thread-safe in-memory registry implementation.
func (*InMemory) Unregister ¶
Unregister removes a skill from the registry.
type Registry ¶
type Registry interface {
// Register adds a skill to the registry.
// Returns ErrSkillExists if a skill with the same name is already registered.
Register(s skill.Skill) error
// Unregister removes a skill from the registry.
// Returns ErrSkillNotFound if the skill is not registered.
Unregister(name string) error
// Get returns a skill by name.
// Returns ErrSkillNotFound if the skill is not registered.
Get(name string) (skill.Skill, error)
// List returns all registered skills.
List() []skill.Skill
// ListTools returns all tools across all registered skills.
// Tool names are prefixed with skill name: "skillname.toolname"
ListTools() []skill.Tool
// GetTool returns a specific tool by its full name (skillname.toolname).
GetTool(fullName string) (skill.Tool, error)
// Init initializes all registered skills.
Init(ctx context.Context) error
// Close closes all registered skills.
Close() error
}
Registry manages skill registration and discovery.
Click to show internal directories.
Click to hide internal directories.