Documentation
¶
Overview ¶
Package postgres restores Postgres dumps into throwaway containers.
Index ¶
- Constants
- type Engine
- func (e *Engine) Cleanup(ctx context.Context, jobID string) error
- func (e *Engine) DetectVersion(ctx context.Context, jobID string, dump job.Dump) (job.Version, error)
- func (e *Engine) Ready(ctx context.Context) error
- func (e *Engine) RemoveOrphans(ctx context.Context, keepJobIDs ...string) error
- func (e *Engine) Start(ctx context.Context, jobID string, version job.Version) (job.Instance, error)
- type Instance
Constants ¶
const ( OldestMajor = 14 NewestMajor = 18 )
Postgres major versions the runner restores into.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine restores Postgres dumps.
func New ¶
New returns an engine that runs its containers through the given client, within the given limits.
func (*Engine) DetectVersion ¶
func (e *Engine) DetectVersion(ctx context.Context, jobID string, dump job.Dump) (job.Version, error)
DetectVersion reads the Postgres version from the dump, or falls back to the newest supported major.
func (*Engine) RemoveOrphans ¶
RemoveOrphans removes what earlier runs left behind, except what belongs to the given jobs.
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
Instance is a running throwaway Postgres server.
func (*Instance) LatestTimestamp ¶
func (i *Instance) LatestTimestamp(ctx context.Context, check job.TimestampCheck) (job.TimestampReading, error)
LatestTimestamp reads the newest value in the chosen column.