Documentation
¶
Overview ¶
Package storage provides domain-specific storage interfaces for ToolHive.
Index ¶
- Variables
- type EntryType
- type ListFilter
- type NoopPluginStore
- func (*NoopPluginStore) Close() error
- func (*NoopPluginStore) Create(_ context.Context, _ plugins.InstalledPlugin) error
- func (*NoopPluginStore) Delete(_ context.Context, _ string, _ plugins.Scope, _ string) error
- func (*NoopPluginStore) Get(_ context.Context, _ string, _ plugins.Scope, _ string) (plugins.InstalledPlugin, error)
- func (*NoopPluginStore) List(_ context.Context, _ ListFilter) ([]plugins.InstalledPlugin, error)
- func (*NoopPluginStore) Update(_ context.Context, _ plugins.InstalledPlugin) error
- 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 PluginStore
- type SkillStore
Constants ¶
This section is empty.
Variables ¶
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 EntryType ¶ added in v0.32.0
type EntryType string
EntryType is the typed discriminator for the entries.entry_type column. The entries table is shared across installed skills and plugins so that a skill and a plugin can share the same name without colliding; the (entry_type, name) pair is unique, not name alone. Both skill_store.go and plugin_store.go reference these constants without importing each other's domain package.
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. Shared by SkillStore and PluginStore (the scope/project-root/client-app filtering shape is identical; ListFilter.Scope is skills.Scope, which plugins.Scope aliases).
type NoopPluginStore ¶ added in v0.32.0
type NoopPluginStore struct{}
NoopPluginStore is a no-op implementation of PluginStore for Kubernetes environments. Mirrors NoopSkillStore: Get returns ErrNotFound, List returns empty, and write operations succeed silently.
func (*NoopPluginStore) Close ¶ added in v0.32.0
func (*NoopPluginStore) Close() error
Close is a no-op that always succeeds.
func (*NoopPluginStore) Create ¶ added in v0.32.0
func (*NoopPluginStore) Create(_ context.Context, _ plugins.InstalledPlugin) error
Create is a no-op that always succeeds.
func (*NoopPluginStore) Get ¶ added in v0.32.0
func (*NoopPluginStore) Get(_ context.Context, _ string, _ plugins.Scope, _ string) (plugins.InstalledPlugin, error)
Get always returns ErrNotFound in the no-op implementation.
func (*NoopPluginStore) List ¶ added in v0.32.0
func (*NoopPluginStore) List(_ context.Context, _ ListFilter) ([]plugins.InstalledPlugin, error)
List always returns an empty slice in the no-op implementation.
func (*NoopPluginStore) Update ¶ added in v0.32.0
func (*NoopPluginStore) Update(_ context.Context, _ plugins.InstalledPlugin) error
Update is a no-op that always succeeds.
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 PluginStore ¶ added in v0.32.0
type PluginStore interface {
// Create stores a new installed plugin.
Create(ctx context.Context, plugin plugins.InstalledPlugin) error
// Get retrieves an installed plugin by name, scope, and project root.
Get(ctx context.Context, name string, scope plugins.Scope, projectRoot string) (plugins.InstalledPlugin, error)
// List returns all installed plugins matching the given filter.
List(ctx context.Context, filter ListFilter) ([]plugins.InstalledPlugin, error)
// Update modifies an existing installed plugin.
Update(ctx context.Context, plugin plugins.InstalledPlugin) error
// Delete removes an installed plugin by name, scope, and project root.
Delete(ctx context.Context, name string, scope plugins.Scope, projectRoot string) error
// Close releases any resources held by the store.
Close() error
}
PluginStore defines the interface for managing plugin persistence. Mirrors SkillStore; the two share the ListFilter type and the entries table but store plugin-specific rows in installed_plugins/plugin_dependencies.
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.