storage

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package storage contains containers that can be used to test all available data stores.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMySQLTestContainer added in v0.2.3

func NewMySQLTestContainer() *mySQLTestContainer

NewMySQLTestContainer returns an implementation of the DatastoreTestContainer interface for MySQL.

func NewPostgresTestContainer added in v0.2.0

func NewPostgresTestContainer() *postgresTestContainer

NewPostgresTestContainer returns an implementation of the DatastoreTestContainer interface for Postgres.

Types

type DatastoreTestContainer added in v0.2.0

type DatastoreTestContainer interface {

	// GetConnectionURI returns a connection string to the datastore instance running inside
	// the container.
	GetConnectionURI(includeCredentials bool) string

	// GetDatabaseSchemaVersion returns the last migration applied (e.g. 3) when the container was created
	GetDatabaseSchemaVersion() int64

	GetUsername() string
	GetPassword() string
}

DatastoreTestContainer represents a runnable container for testing specific datastore engines.

func RunDatastoreTestContainer added in v0.2.0

func RunDatastoreTestContainer(t testing.TB, engine string) DatastoreTestContainer

RunDatastoreTestContainer constructs and runs a specific DatastoreTestContainer for the provided datastore engine. If applicable, it also runs all existing database migrations. The resources used by the test engine will be cleaned up after the test has finished.

Jump to

Keyboard shortcuts

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