datastore

package
v1.6.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InitFunc

type InitFunc func(engine, uri string) datastore.Datastore

InitFunc initialize a datastore instance from a uri that has been generated from a TestDatastoreBuilder

type TestDatastoreBuilder

type TestDatastoreBuilder interface {
	// NewDatastore returns a new logical datastore initialized with the
	// initFunc. For example, the sql based stores will create a new logical
	// database in the database instance and provide the URI for it to initFunc
	NewDatastore(t testing.TB, initFunc InitFunc) datastore.Datastore
}

TestDatastoreBuilder stamps out new datastores from a backing service (like a container running a database).

func NewCRDBBuilder

func NewCRDBBuilder(t testing.TB) TestDatastoreBuilder

NewCRDBBuilder returns a TestDatastoreBuilder for CRDB

func NewCRDBPGBuilder

func NewCRDBPGBuilder(t testing.TB) TestDatastoreBuilder

NewCRDBPGBuilder returns a TestDatastoreBuilder for the postgres driver backed by a CRDB instance

func NewPostgresBuilder

func NewPostgresBuilder(t testing.TB) TestDatastoreBuilder

NewPostgresBuilder returns a TestDatastoreBuilder for postgres

func NewSpannerBuilder

func NewSpannerBuilder(t testing.TB) TestDatastoreBuilder

NewSpannerBuilder returns a TestDatastoreBuilder for spanner

func NewTestDatastoreBuilder

func NewTestDatastoreBuilder(t testing.TB, engine string) TestDatastoreBuilder

NewTestDatastoreBuilder returns a TestDatastoreBuilder for a given engine this is primarily useful for tests against all datastores; most other tests can directly build the datastore they want

type TestDatastoreBuilderFunc

type TestDatastoreBuilderFunc func(t testing.TB, initFunc InitFunc) datastore.Datastore

TestDatastoreBuilderFunc allows a function to implement TestDatastoreBuilder

func (TestDatastoreBuilderFunc) NewDatastore

func (f TestDatastoreBuilderFunc) NewDatastore(t testing.TB, initFunc InitFunc) datastore.Datastore

NewDatastore implements TestDatastoreBuilder

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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