Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DS ¶
DS is a concrete implementation for a database
func (*DS) BeginTx ¶
BeginTx is a wrapper for sql.DB.BeginTx in order to expose from the Datastore interface
func (*DS) CommitTx ¶
CommitTx is a wrapper for sql.Tx.Commit in order to expose from the Datastore interface. Proper error handling is also considered.
func (*DS) RollbackTx ¶
RollbackTx is a wrapper for sql.Tx.Rollback in order to expose from the Datastore interface. Proper error handling is also considered.
type Datastore ¶
type Datastore interface {
BeginTx(context.Context) error
RollbackTx(error) error
CommitTx() error
}
Datastore is an interface for working with the Database
func ProvideDatastore ¶
ProvideDatastore provides either a DS struct, which has a concrete implementation of a database or a MockDS struct which is a mocked DB implementation
type MockDS ¶
type MockDS struct {
}
MockDS is a mock implementation for a database
func (*MockDS) BeginTx ¶
BeginTx is a wrapper for sql.DB.BeginTx in order to expose from the Datastore interface
func (*MockDS) CommitTx ¶
CommitTx is a wrapper for sql.Tx.Commit in order to expose from the Datastore interface. Proper error handling is also considered.
func (*MockDS) RollbackTx ¶
RollbackTx is a wrapper for sql.Tx.Rollback in order to expose from the Datastore interface. Proper error handling is also considered.