Help us shape the future of Go! Take the 2026 Go Developer Survey

runtimeprofile

package
v0.27.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrStale = errors.New("RuntimeProfile memory index revision changed")

ErrStale means the persisted Profile revision changed while a caller was selecting an immutable memory snapshot.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	RuntimeProfileID string
	Kind             string
	Name             string
	Value            json.RawMessage
}

Entry is one RuntimeProfile binding or configuration item in the process-local SQLite index. Value is the item's JSON representation.

type Index

type Index struct {
	// contains filtered or unexported fields
}

Index owns one published, read-only in-memory SQLite snapshot at a time.

func New

func New(source Source, refreshInterval time.Duration) *Index

New creates a runtime index backed by in-memory SQLite.

func (*Index) Close

func (s *Index) Close() error

Close releases the process-local SQLite index. The Source owns persistent storage.

func (*Index) Generation

func (s *Index) Generation() uint64

Generation increases when a new immutable SQLite instance is published.

func (*Index) GetEntry

func (s *Index) GetEntry(ctx context.Context, profileID, kind, name string) (Entry, error)

GetEntry resolves one decomposed entry by Profile ID, kind, and name. A missing entry returns sql.ErrNoRows.

func (*Index) Initialize

func (s *Index) Initialize(ctx context.Context) error

Initialize publishes the first snapshot and starts periodic rotation.

func (*Index) ListEntries

func (s *Index) ListEntries(ctx context.Context, kind string) ([]Entry, error)

ListEntries reads every indexed entry of one kind across all profiles. Kinds are workflow, model, voice, tool, memory, app_config, safety_fence, and mhs.v0.device. Entries are ordered by profile ID and name.

func (*Index) ListProfileIDs

func (s *Index) ListProfileIDs(ctx context.Context) ([]string, error)

ListProfileIDs lists every RuntimeProfile represented in the memory index.

func (*Index) ListProfileWorkflowsByTags

func (s *Index) ListProfileWorkflowsByTags(ctx context.Context, profileID, revision string, tags []string) ([]Entry, error)

ListProfileWorkflowsByTags queries the immutable SQLite snapshot for one Profile revision. It refreshes once if another Server changed that Profile.

func (*Index) ListWorkflowsByTags

func (s *Index) ListWorkflowsByTags(ctx context.Context, tags []string) ([]Entry, error)

ListWorkflowsByTags reads Workflow bindings across all profiles. A Workflow must contain every requested opaque tag; an empty selector matches all.

func (*Index) Refresh

func (s *Index) Refresh(ctx context.Context) error

Refresh rebuilds the process-local, decomposed index from every persisted RuntimeProfile. Call it after changes made by another Server.

type Source

type Source interface {
	ForEachProfile(context.Context, func(apitypes.RuntimeProfile) error) error
}

Source enumerates complete persisted profiles into a new runtime snapshot. Consumers can perform slow work; implementations must release persistent storage cursors and transactions before calling the consumer.

Jump to

Keyboard shortcuts

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