 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 DSName ¶
type DSName int
DSName defines the name for the Datastore
const ( // LocalDatastore represents the local PostgreSQL db LocalDatastore DSName = iota // GCPCPDatastore represents a local connection to a GCP Cloud // SQL db through the Google Cloud Proxy GCPCPDatastore // GCPDatastore represents a true GCP connection to a GCP // Cloud SQL db GCPDatastore // MockDatastore represents a Mocked Database MockDatastore )
type Datastore ¶
type Datastore interface {
	BeginTx(context.Context) error
	RollbackTx(error) error
	CommitTx() error
}
    Datastore is an interface for working with the Database
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.