presets

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package presets owns reusable inference configuration presets and persistence.

Index

Constants

View Source
const (
	// StorageSchemaVersion identifies the only preset schema.
	StorageSchemaVersion = 1
	// StoragePrefix is the preset v1 namespace.
	StoragePrefix = "presets:v1:name:"
)

Variables

View Source
var (
	// ErrRepositoryRequired reports an absent preset storage adapter.
	ErrRepositoryRequired = errors.New("preset storage is required")
	// ErrNotFound reports an absent preset.
	ErrNotFound = errors.New("preset not found")
	// ErrConflict reports a preset revision conflict.
	ErrConflict = errors.New("preset revision conflict")
	// ErrCorruptRecord reports invalid durable preset data.
	ErrCorruptRecord = errors.New("preset record is invalid")
	// ErrNameImmutable reports an attempted preset-name change.
	ErrNameImmutable = errors.New("preset name is immutable")
)

Functions

This section is empty.

Types

type Preset

type Preset struct {
	ID          string         `json:"id"`
	Name        string         `json:"name"`
	Description string         `json:"description,omitempty"`
	Config      map[string]any `json:"config"`
	Version     int            `json:"version"`
	CreatedAt   time.Time      `json:"created_at"`
	UpdatedAt   time.Time      `json:"updated_at"`
}

Preset is one reusable inference configuration.

func (Preset) Validate

func (p Preset) Validate() error

Validate checks preset invariants.

type Record

type Record struct {
	Revision uint64
	Preset   Preset
}

Record is one versioned preset repository value.

type Repository

type Repository interface {
	Create(context.Context, Preset) (Record, error)
	Get(context.Context, string) (Record, error)
	List(context.Context, int) ([]Record, error)
	Update(context.Context, Preset, uint64) (Record, error)
	Delete(context.Context, string, uint64) error
}

Repository is the durable preset contract.

func Open

func Open(store storage.KVStore) (Repository, error)

Open returns a storage-backed preset repository.

Jump to

Keyboard shortcuts

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