storage

package
v0.9.4 Latest Latest
Warning

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

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

Documentation

Overview

Package storage provides domain-specific storage interfaces for ToolHive.

Index

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

Create is a no-op that always succeeds.

func (*NoopSkillStore) Delete

Delete is a no-op that always succeeds.

func (*NoopSkillStore) Get

Get always returns ErrNotFound in the no-op implementation.

func (*NoopSkillStore) List

List always returns an empty slice in the no-op implementation.

func (*NoopSkillStore) Update

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.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
Package sqlite provides SQLite-backed persistent storage for ToolHive.
Package sqlite provides SQLite-backed persistent storage for ToolHive.

Jump to

Keyboard shortcuts

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