Documentation
¶
Overview ¶
Package storage provides domain-specific storage interfaces for ToolHive.
Index ¶
- Variables
- type ListFilter
- type NoopSkillStore
- func (*NoopSkillStore) Close() error
- func (*NoopSkillStore) Create(_ context.Context, _ skills.InstalledSkill) error
- func (*NoopSkillStore) Delete(_ context.Context, _ string, _ skills.Scope, _ string) error
- func (*NoopSkillStore) Get(_ context.Context, _ string, _ skills.Scope, _ string) (skills.InstalledSkill, error)
- func (*NoopSkillStore) List(_ context.Context, _ ListFilter) ([]skills.InstalledSkill, error)
- func (*NoopSkillStore) Update(_ context.Context, _ skills.InstalledSkill) error
- type SkillStore
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound is returned when a requested resource does not exist. ErrNotFound = httperr.WithCode( errors.New("resource not found"), http.StatusNotFound, ) // ErrAlreadyExists is returned when a resource already exists. ErrAlreadyExists = httperr.WithCode( errors.New("resource already exists"), http.StatusConflict, ) )
Functions ¶
This section is empty.
Types ¶
type ListFilter ¶
type ListFilter struct {
// Scope filters by installation scope. Empty matches all scopes.
Scope skills.Scope
// ProjectRoot filters by project root path. Empty matches all projects.
ProjectRoot string
// ClientApp filters by client application. Empty matches all clients.
ClientApp string
}
ListFilter configures filtering for List operations.
type NoopSkillStore ¶
type NoopSkillStore struct{}
NoopSkillStore is a no-op implementation of SkillStore for Kubernetes environments. Get always returns ErrNotFound, List returns empty, and write operations succeed silently.
func (*NoopSkillStore) Close ¶
func (*NoopSkillStore) Close() error
Close is a no-op that always succeeds.
func (*NoopSkillStore) Create ¶
func (*NoopSkillStore) Create(_ context.Context, _ skills.InstalledSkill) error
Create is a no-op that always succeeds.
func (*NoopSkillStore) Get ¶
func (*NoopSkillStore) Get(_ context.Context, _ string, _ skills.Scope, _ string) (skills.InstalledSkill, error)
Get always returns ErrNotFound in the no-op implementation.
func (*NoopSkillStore) List ¶
func (*NoopSkillStore) List(_ context.Context, _ ListFilter) ([]skills.InstalledSkill, error)
List always returns an empty slice in the no-op implementation.
func (*NoopSkillStore) Update ¶
func (*NoopSkillStore) Update(_ context.Context, _ skills.InstalledSkill) error
Update is a no-op that always succeeds.
type SkillStore ¶
type SkillStore interface {
// Create stores a new installed skill.
Create(ctx context.Context, skill skills.InstalledSkill) error
// Get retrieves an installed skill by name, scope, and project root.
Get(ctx context.Context, name string, scope skills.Scope, projectRoot string) (skills.InstalledSkill, error)
// List returns all installed skills matching the given filter.
List(ctx context.Context, filter ListFilter) ([]skills.InstalledSkill, error)
// Update modifies an existing installed skill.
Update(ctx context.Context, skill skills.InstalledSkill) error
// Delete removes an installed skill by name, scope, and project root.
Delete(ctx context.Context, name string, scope skills.Scope, projectRoot string) error
// Close releases any resources held by the store.
Close() error
}
SkillStore defines the interface for managing skill persistence.
Click to show internal directories.
Click to hide internal directories.