Documentation ¶
Index ¶
- func Create(db DB) error
- func Exec(db DB) error
- func Query(db DB) error
- type DB
- type MockDB
- func (_m *MockDB) EXPECT() *_MockDBRecorder
- func (_m *MockDB) Exec(_param0 string, _param1 ...interface{}) (sql.Result, error)
- func (_m *MockDB) Prepare(_param0 string) (*sql.Stmt, error)
- func (_m *MockDB) Query(_param0 string, _param1 ...interface{}) (*sql.Rows, error)
- func (_m *MockDB) QueryRow(_param0 string, _param1 ...interface{}) *sql.Row
- type MockTransaction
- func (_m *MockTransaction) Commit() error
- func (_m *MockTransaction) EXPECT() *_MockTransactionRecorder
- func (_m *MockTransaction) Exec(_param0 string, _param1 ...interface{}) (sql.Result, error)
- func (_m *MockTransaction) Prepare(_param0 string) (*sql.Stmt, error)
- func (_m *MockTransaction) Query(_param0 string, _param1 ...interface{}) (*sql.Rows, error)
- func (_m *MockTransaction) QueryRow(_param0 string, _param1 ...interface{}) *sql.Row
- func (_m *MockTransaction) Rollback() error
- func (_m *MockTransaction) Stmt(_param0 *sql.Stmt) *sql.Stmt
- type Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DB ¶
type DB interface { Exec(query string, args ...interface{}) (sql.Result, error) Prepare(query string) (*sql.Stmt, error) Query(query string, args ...interface{}) (*sql.Rows, error) QueryRow(query string, args ...interface{}) *sql.Row }
DB is an interface that is satisfied by an sql.DB or an sql.Transaction
type MockDB ¶
type MockDB struct {
// contains filtered or unexported fields
}
Mock of DB interface
func NewMockDB ¶
func NewMockDB(ctrl *gomock.Controller) *MockDB
type MockTransaction ¶
type MockTransaction struct {
// contains filtered or unexported fields
}
Mock of Transaction interface
func NewMockTransaction ¶
func NewMockTransaction(ctrl *gomock.Controller) *MockTransaction
func (*MockTransaction) Commit ¶
func (_m *MockTransaction) Commit() error
func (*MockTransaction) EXPECT ¶
func (_m *MockTransaction) EXPECT() *_MockTransactionRecorder
func (*MockTransaction) Exec ¶
func (_m *MockTransaction) Exec(_param0 string, _param1 ...interface{}) (sql.Result, error)
func (*MockTransaction) Prepare ¶
func (_m *MockTransaction) Prepare(_param0 string) (*sql.Stmt, error)
func (*MockTransaction) Query ¶
func (_m *MockTransaction) Query(_param0 string, _param1 ...interface{}) (*sql.Rows, error)
func (*MockTransaction) QueryRow ¶
func (_m *MockTransaction) QueryRow(_param0 string, _param1 ...interface{}) *sql.Row
func (*MockTransaction) Rollback ¶
func (_m *MockTransaction) Rollback() error
type Transaction ¶
Transaction can do anything a Query can do plus Commit, Rollback, or Stmt
Click to show internal directories.
Click to hide internal directories.