Documentation
¶
Overview ¶
Package memory provides an in-memory implementation of the Sentinel composite store. Suitable for testing and development.
Index ¶
- type Store
- func (s *Store) AdvanceRecordedCursor(ctx context.Context, req recorded.CursorAdvance) (*recorded.SourceCursor, error)
- func (s *Store) CancelRun(_ context.Context, runID id.EvalRunID, at time.Time) (bool, error)
- func (s *Store) Close() error
- func (s *Store) CountCases(_ context.Context, suiteID id.SuiteID) (int64, error)
- func (s *Store) CreateCase(_ context.Context, tc *testcase.Case) error
- func (s *Store) CreateCaseBatch(_ context.Context, cases []*testcase.Case) error
- func (s *Store) CreateEvaluationPlan(ctx context.Context, p *evalplan.Plan) error
- func (s *Store) CreatePromptVersion(_ context.Context, pv *promptversion.PromptVersion) error
- func (s *Store) CreateRecordedJob(ctx context.Context, j *recorded.Job) (*recorded.Job, error)
- func (s *Store) CreateResult(_ context.Context, result *evalrun.Result) error
- func (s *Store) CreateResultBatch(_ context.Context, results []*evalrun.Result) error
- func (s *Store) CreateRun(_ context.Context, run *evalrun.Run) error
- func (s *Store) CreateSuite(_ context.Context, su *suite.Suite) error
- func (s *Store) DeleteBaseline(_ context.Context, baselineID id.BaselineID) error
- func (s *Store) DeleteCase(_ context.Context, caseID id.CaseID) error
- func (s *Store) DeleteSuite(_ context.Context, suiteID id.SuiteID) error
- func (s *Store) FinalizeRun(_ context.Context, runID id.EvalRunID, f *evalrun.Finalization) (evalrun.RunState, error)
- func (s *Store) GetBaseline(_ context.Context, baselineID id.BaselineID) (*baseline.Baseline, error)
- func (s *Store) GetCase(_ context.Context, caseID id.CaseID) (*testcase.Case, error)
- func (s *Store) GetCurrentPromptVersion(_ context.Context, suiteID id.SuiteID) (*promptversion.PromptVersion, error)
- func (s *Store) GetEvaluationPlan(ctx context.Context, planID id.ID) (*evalplan.Plan, error)
- func (s *Store) GetLatestBaseline(_ context.Context, suiteID id.SuiteID) (*baseline.Baseline, error)
- func (s *Store) GetPromptVersion(_ context.Context, pvID id.PromptVersionID) (*promptversion.PromptVersion, error)
- func (s *Store) GetRecordedCursor(ctx context.Context, binding string) (*recorded.SourceCursor, error)
- func (s *Store) GetRecordedJob(ctx context.Context, jobID id.ID) (*recorded.Job, error)
- func (s *Store) GetResultStats(ctx context.Context, runID id.EvalRunID) (*evalrun.ResultStats, error)
- func (s *Store) GetRun(_ context.Context, runID id.EvalRunID) (*evalrun.Run, error)
- func (s *Store) GetSuite(_ context.Context, suiteID id.SuiteID) (*suite.Suite, error)
- func (s *Store) GetSuiteByName(_ context.Context, appID, name string) (*suite.Suite, error)
- func (s *Store) ImportCases(_ context.Context, _ id.SuiteID, _ string, _ []byte) (int64, error)
- func (s *Store) ListBaselines(_ context.Context, suiteID id.SuiteID) ([]*baseline.Baseline, error)
- func (s *Store) ListCases(_ context.Context, suiteID id.SuiteID) ([]*testcase.Case, error)
- func (s *Store) ListPromptVersions(_ context.Context, suiteID id.SuiteID) ([]*promptversion.PromptVersion, error)
- func (s *Store) ListRecordedJobs(ctx context.Context, q recorded.Query) ([]*recorded.Job, error)
- func (s *Store) ListResults(_ context.Context, runID id.EvalRunID) ([]*evalrun.Result, error)
- func (s *Store) ListRuns(_ context.Context, filter *evalrun.ListFilter) ([]*evalrun.Run, error)
- func (s *Store) ListRunsBySuite(_ context.Context, suiteID id.SuiteID) ([]*evalrun.Run, error)
- func (s *Store) ListSuites(_ context.Context, filter *suite.ListFilter) ([]*suite.Suite, error)
- func (s *Store) Migrate(_ context.Context) error
- func (s *Store) Ping(_ context.Context) error
- func (s *Store) RecordedPersistent(_ context.Context) (bool, error)
- func (s *Store) SaveBaseline(_ context.Context, b *baseline.Baseline) error
- func (s *Store) SetCurrentPromptVersion(_ context.Context, suiteID id.SuiteID, pvID id.PromptVersionID) error
- func (s *Store) UpdateCase(_ context.Context, tc *testcase.Case) error
- func (s *Store) UpdateRecordedJob(ctx context.Context, expected int64, j *recorded.Job) error
- func (s *Store) UpdateRun(_ context.Context, run *evalrun.Run) error
- func (s *Store) UpdateSuite(_ context.Context, su *suite.Suite) error
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 (*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) CountCases ¶
func (*Store) CreateCaseBatch ¶
func (*Store) CreateEvaluationPlan ¶
CreateEvaluationPlan stores a detached immutable snapshot.
func (*Store) CreatePromptVersion ¶
func (s *Store) CreatePromptVersion(_ context.Context, pv *promptversion.PromptVersion) error
func (*Store) CreateRecordedJob ¶
CreateRecordedJob atomically deduplicates an immutable request.
func (*Store) CreateResult ¶
func (*Store) CreateResultBatch ¶
func (*Store) DeleteBaseline ¶
func (*Store) DeleteSuite ¶
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 (*Store) GetBaseline ¶
func (*Store) GetCurrentPromptVersion ¶
func (s *Store) GetCurrentPromptVersion(_ context.Context, suiteID id.SuiteID) (*promptversion.PromptVersion, error)
func (*Store) GetEvaluationPlan ¶
GetEvaluationPlan reads an exact app and tenant snapshot.
func (*Store) GetLatestBaseline ¶
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 ¶
GetRecordedJob reads only the exact app and tenant.
func (*Store) GetResultStats ¶
func (*Store) GetSuiteByName ¶
func (*Store) ImportCases ¶
func (*Store) ListBaselines ¶
func (*Store) ListPromptVersions ¶
func (s *Store) ListPromptVersions(_ context.Context, suiteID id.SuiteID) ([]*promptversion.PromptVersion, error)
func (*Store) ListRecordedJobs ¶
ListRecordedJobs returns a stable ID page within the exact scope.
func (*Store) ListResults ¶
func (*Store) ListRunsBySuite ¶
func (*Store) ListSuites ¶
func (*Store) RecordedPersistent ¶
RecordedPersistent reports that memory jobs cannot survive process restart.
func (*Store) SaveBaseline ¶
func (*Store) SetCurrentPromptVersion ¶
func (*Store) UpdateRecordedJob ¶
UpdateRecordedJob writes a fenced checkpoint under an atomic revision check.