recstore

package
v1.154.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package recstore is the PostgreSQL store of managed-script recordings (internal/platform/scriptrec, migration 000166).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sealer added in v1.153.0

type Sealer interface {
	Enabled() bool
	SealBound(binding, plaintext string) (string, error)
	OpenBound(binding, sealed string) (string, error)
}

Sealer encrypts a recording at rest, bound to its run (#2402): the platform's field encryptor.

type Store

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

Store keeps recordings in script_recordings.

func New

func New(db *sql.DB) *Store

New returns a Store over db.

func (*Store) Get

func (s *Store) Get(ctx context.Context, runID string) (*scriptrec.Stored, error)

Get returns one recording.

func (*Store) Keep

func (s *Store) Keep(ctx context.Context, scriptID, author string, runIDs []string) error

Keep marks the recordings a script's latest version names in its tests.

func (*Store) Purge

func (s *Store) Purge(ctx context.Context, retention time.Duration) (int64, error)

Purge deletes the recordings past retention that no test keeps.

func (*Store) Recent

func (s *Store) Recent(ctx context.Context, scriptID string, limit int) ([]scriptrec.Stored, error)

Recent returns the newest replayable recordings of the script's successful runs.

func (*Store) Save

func (s *Store) Save(ctx context.Context, rec scriptrec.Stored) error

Save stores a recording, replacing one under the same run id.

func (*Store) Sealed added in v1.153.0

func (s *Store) Sealed(sealer Sealer) *Store

Sealed has the store encrypt every recording it saves with sealer, when sealer holds a key (#2402). A recording keeps each call's arguments and answer -- a statement's bound values, a value a script decrypted, the rows a query returned -- so it is sealed whole, bound to its run id so one run's recording is never opened as another's. A recording saved before the key was set is read as it was stored.

Jump to

Keyboard shortcuts

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