Documentation ¶
Index ¶
Constants ¶
const ( // Connection types BADGER string = "badger" COCKROACH string = "cockroach" TESTSTORE string = "teststore" UNDEFINED string = "undefined" )
db-wide constants
const ( TestCreatedTime = "2006-01-02T15:04:05Z" TestUpdatedTime = "2006-01-08T10:00:08Z" TestKey = "a key" TestVal = "a value" )
Constants for testing
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BadgerConnector ¶
BadgerConnector ...
func NewBadgerConnector ¶
func NewBadgerConnector(cfg *config.Config) (*BadgerConnector, error)
NewBadgerConnector ...
func (*BadgerConnector) Close ¶
func (c *BadgerConnector) Close() error
Close closes the connection to the database
func (*BadgerConnector) DBType ¶
func (c *BadgerConnector) DBType() string
DBType returns the database type
type CockroachConnector ¶
type CockroachConnector struct {
ConnType string
}
CockroachConnector ...
func NewCockroachConnector ¶
func NewCockroachConnector(_ *config.Config) (*CockroachConnector, error)
NewCockroachConnector ...
func (*CockroachConnector) Close ¶
func (c *CockroachConnector) Close() error
Close closes the connection to the database
func (*CockroachConnector) DBType ¶
func (c *CockroachConnector) DBType() string
DBType returns the database type
type TestStoreConnector ¶
type TestStoreConnector struct {
ConnType string
}
TestStoreConnector is for test dbs that will be used in unit tests
func NewTestStoreConnector ¶
func NewTestStoreConnector(_ *config.Config) (*TestStoreConnector, error)
NewTestStoreConnector is for use with unit tests
func (*TestStoreConnector) Close ¶
func (c *TestStoreConnector) Close() error
Close closes the connection to the database
func (*TestStoreConnector) DBType ¶
func (c *TestStoreConnector) DBType() string
DBType returns the database type
type UndefinedConnector ¶
type UndefinedConnector struct {
ConnType string
}
UndefinedConnector is for situations where an implementation needs to be returned, even when there is none.
func NewUndefinedConnection ¶
func NewUndefinedConnection(err error) (*UndefinedConnector, error)
NewUndefinedConnection is for use with unit tests
func (*UndefinedConnector) Close ¶
func (c *UndefinedConnector) Close() error
Close closes the connection to the database
func (*UndefinedConnector) DBType ¶
func (c *UndefinedConnector) DBType() string
DBType returns the database type