Documentation
¶
Overview ¶
Package recstore is the PostgreSQL store of managed-script recordings (internal/platform/scriptrec, migration 000166).
Index ¶
- type Sealer
- type Store
- func (s *Store) Get(ctx context.Context, runID string) (*scriptrec.Stored, error)
- func (s *Store) Keep(ctx context.Context, scriptID, author string, runIDs []string) error
- func (s *Store) Purge(ctx context.Context, retention time.Duration) (int64, error)
- func (s *Store) Recent(ctx context.Context, scriptID string, limit int) ([]scriptrec.Stored, error)
- func (s *Store) Save(ctx context.Context, rec scriptrec.Stored) error
- func (s *Store) Sealed(sealer Sealer) *Store
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 (*Store) Recent ¶
Recent returns the newest replayable recordings of the script's successful runs.
func (*Store) Sealed ¶ added in v1.153.0
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.