Documentation
¶
Index ¶
- Variables
- type Entry
- type Index
- func (s *Index) Close() error
- func (s *Index) Generation() uint64
- func (s *Index) GetEntry(ctx context.Context, profileID, kind, name string) (Entry, error)
- func (s *Index) Initialize(ctx context.Context) error
- func (s *Index) ListEntries(ctx context.Context, kind string) ([]Entry, error)
- func (s *Index) ListProfileIDs(ctx context.Context) ([]string, error)
- func (s *Index) ListProfileWorkflowsByTags(ctx context.Context, profileID, revision string, tags []string) ([]Entry, error)
- func (s *Index) ListWorkflowsByTags(ctx context.Context, tags []string) ([]Entry, error)
- func (s *Index) Refresh(ctx context.Context) error
- type Source
Constants ¶
This section is empty.
Variables ¶
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 (*Index) Close ¶
Close releases the process-local SQLite index. The Source owns persistent storage.
func (*Index) Generation ¶
Generation increases when a new immutable SQLite instance is published.
func (*Index) GetEntry ¶
GetEntry resolves one decomposed entry by Profile ID, kind, and name. A missing entry returns sql.ErrNoRows.
func (*Index) Initialize ¶
Initialize publishes the first snapshot and starts periodic rotation.
func (*Index) ListEntries ¶
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 ¶
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 ¶
ListWorkflowsByTags reads Workflow bindings across all profiles. A Workflow must contain every requested opaque tag; an empty selector matches all.
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.