Documentation
¶
Overview ¶
Package engines defines the DatabaseEngine interface implemented by every supported database backend.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckResult ¶
type CheckResult struct {
Name string
Status string // PASS, FAIL, NOT_RUN, SKIPPED
Expected string
Actual string
Err error
}
CheckResult is the outcome of a single validation check.
type DatabaseEngine ¶
type DatabaseEngine interface {
// Name returns the engine identifier (e.g. "postgres").
Name() string
// RequiredCapabilities returns the Linux capabilities the
// engine needs inside its container.
RequiredCapabilities() []string
// WaitUntilReady blocks until the database accepts connections
// or the context is cancelled.
WaitUntilReady(ctx context.Context, c *sandbox.Container, username, database string) error
// Restore loads the artifact into the target database using the
// options specified in the contract.
Restore(ctx context.Context, c *sandbox.Container, artifactPath string, opts contract.Test) error
// RunCheck executes a single validation check.
RunCheck(ctx context.Context, c *sandbox.Container, chk contract.Check, opts contract.Test) (CheckResult, error)
}
DatabaseEngine is implemented by every supported database backend.
Click to show internal directories.
Click to hide internal directories.