recstore

package
v1.169.3 Latest Latest
Warning

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

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

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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