memory

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package memory provides an in-memory implementation of the Sentinel composite store. Suitable for testing and development.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store is an in-memory implementation of the composite Sentinel store.

func New

func New() *Store

New creates a new in-memory store.

func (*Store) AdvanceRecordedCursor

func (s *Store) AdvanceRecordedCursor(ctx context.Context, req recorded.CursorAdvance) (*recorded.SourceCursor, error)

AdvanceRecordedCursor acknowledges only a job this store already persisted.

func (*Store) CancelRun

func (s *Store) CancelRun(_ context.Context, runID id.EvalRunID, at time.Time) (bool, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) CountCases

func (s *Store) CountCases(_ context.Context, suiteID id.SuiteID) (int64, error)

func (*Store) CreateCase

func (s *Store) CreateCase(_ context.Context, tc *testcase.Case) error

func (*Store) CreateCaseBatch

func (s *Store) CreateCaseBatch(_ context.Context, cases []*testcase.Case) error

func (*Store) CreateEvaluationPlan

func (s *Store) CreateEvaluationPlan(ctx context.Context, p *evalplan.Plan) error

CreateEvaluationPlan stores a detached immutable snapshot.

func (*Store) CreatePromptVersion

func (s *Store) CreatePromptVersion(_ context.Context, pv *promptversion.PromptVersion) error

func (*Store) CreateRecordedJob

func (s *Store) CreateRecordedJob(ctx context.Context, j *recorded.Job) (*recorded.Job, error)

CreateRecordedJob atomically deduplicates an immutable request.

func (*Store) CreateResult

func (s *Store) CreateResult(_ context.Context, result *evalrun.Result) error

func (*Store) CreateResultBatch

func (s *Store) CreateResultBatch(_ context.Context, results []*evalrun.Result) error

func (*Store) CreateRun

func (s *Store) CreateRun(_ context.Context, run *evalrun.Run) error

func (*Store) CreateSuite

func (s *Store) CreateSuite(_ context.Context, su *suite.Suite) error

func (*Store) DeleteBaseline

func (s *Store) DeleteBaseline(_ context.Context, baselineID id.BaselineID) error

func (*Store) DeleteCase

func (s *Store) DeleteCase(_ context.Context, caseID id.CaseID) error

func (*Store) DeleteSuite

func (s *Store) DeleteSuite(_ context.Context, suiteID id.SuiteID) error

DeleteSuite deletes a suite and everything that belongs to it. A suite that does not exist is not an error, as on the other backends.

func (*Store) FinalizeRun

func (s *Store) FinalizeRun(_ context.Context, runID id.EvalRunID, f *evalrun.Finalization) (evalrun.RunState, error)

func (*Store) GetBaseline

func (s *Store) GetBaseline(_ context.Context, baselineID id.BaselineID) (*baseline.Baseline, error)

func (*Store) GetCase

func (s *Store) GetCase(_ context.Context, caseID id.CaseID) (*testcase.Case, error)

func (*Store) GetCurrentPromptVersion

func (s *Store) GetCurrentPromptVersion(_ context.Context, suiteID id.SuiteID) (*promptversion.PromptVersion, error)

func (*Store) GetEvaluationPlan

func (s *Store) GetEvaluationPlan(ctx context.Context, planID id.ID) (*evalplan.Plan, error)

GetEvaluationPlan reads an exact app and tenant snapshot.

func (*Store) GetLatestBaseline

func (s *Store) GetLatestBaseline(_ context.Context, suiteID id.SuiteID) (*baseline.Baseline, error)

func (*Store) GetPromptVersion

func (s *Store) GetPromptVersion(_ context.Context, pvID id.PromptVersionID) (*promptversion.PromptVersion, error)

func (*Store) GetRecordedCursor

func (s *Store) GetRecordedCursor(ctx context.Context, binding string) (*recorded.SourceCursor, error)

GetRecordedCursor reads an exact app/tenant binding acknowledgment.

func (*Store) GetRecordedJob

func (s *Store) GetRecordedJob(ctx context.Context, jobID id.ID) (*recorded.Job, error)

GetRecordedJob reads only the exact app and tenant.

func (*Store) GetResultStats

func (s *Store) GetResultStats(ctx context.Context, runID id.EvalRunID) (*evalrun.ResultStats, error)

func (*Store) GetRun

func (s *Store) GetRun(_ context.Context, runID id.EvalRunID) (*evalrun.Run, error)

func (*Store) GetSuite

func (s *Store) GetSuite(_ context.Context, suiteID id.SuiteID) (*suite.Suite, error)

func (*Store) GetSuiteByName

func (s *Store) GetSuiteByName(_ context.Context, appID, name string) (*suite.Suite, error)

func (*Store) ImportCases

func (s *Store) ImportCases(_ context.Context, _ id.SuiteID, _ string, _ []byte) (int64, error)

func (*Store) ListBaselines

func (s *Store) ListBaselines(_ context.Context, suiteID id.SuiteID) ([]*baseline.Baseline, error)

func (*Store) ListCases

func (s *Store) ListCases(_ context.Context, suiteID id.SuiteID) ([]*testcase.Case, error)

func (*Store) ListPromptVersions

func (s *Store) ListPromptVersions(_ context.Context, suiteID id.SuiteID) ([]*promptversion.PromptVersion, error)

func (*Store) ListRecordedJobs

func (s *Store) ListRecordedJobs(ctx context.Context, q recorded.Query) ([]*recorded.Job, error)

ListRecordedJobs returns a stable ID page within the exact scope.

func (*Store) ListResults

func (s *Store) ListResults(_ context.Context, runID id.EvalRunID) ([]*evalrun.Result, error)

func (*Store) ListRuns

func (s *Store) ListRuns(_ context.Context, filter *evalrun.ListFilter) ([]*evalrun.Run, error)

func (*Store) ListRunsBySuite

func (s *Store) ListRunsBySuite(_ context.Context, suiteID id.SuiteID) ([]*evalrun.Run, error)

func (*Store) ListSuites

func (s *Store) ListSuites(_ context.Context, filter *suite.ListFilter) ([]*suite.Suite, error)

func (*Store) Migrate

func (s *Store) Migrate(_ context.Context) error

func (*Store) Ping

func (s *Store) Ping(_ context.Context) error

func (*Store) RecordedPersistent

func (s *Store) RecordedPersistent(_ context.Context) (bool, error)

RecordedPersistent reports that memory jobs cannot survive process restart.

func (*Store) SaveBaseline

func (s *Store) SaveBaseline(_ context.Context, b *baseline.Baseline) error

func (*Store) SetCurrentPromptVersion

func (s *Store) SetCurrentPromptVersion(_ context.Context, suiteID id.SuiteID, pvID id.PromptVersionID) error

func (*Store) UpdateCase

func (s *Store) UpdateCase(_ context.Context, tc *testcase.Case) error

func (*Store) UpdateRecordedJob

func (s *Store) UpdateRecordedJob(ctx context.Context, expected int64, j *recorded.Job) error

UpdateRecordedJob writes a fenced checkpoint under an atomic revision check.

func (*Store) UpdateRun

func (s *Store) UpdateRun(_ context.Context, run *evalrun.Run) error

func (*Store) UpdateSuite

func (s *Store) UpdateSuite(_ context.Context, su *suite.Suite) error

Jump to

Keyboard shortcuts

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