Documentation ¶
Index ¶
- Variables
- type HookCounter
- type MockDB
- func (m *MockDB) AddHook(queryName string, query QueryValuesFunc, queryRow QueryRowValuesFunc, ...) HookCounter
- func (m *MockDB) AddQueryHook(queryName string, queryFunc QueryValuesFunc) HookCounter
- func (m *MockDB) AddQueryResultHook(queryName string, resultFunc ResultValuesFunc) HookCounter
- func (m *MockDB) AddQueryRowHook(queryName string, queryRowFunc QueryRowValuesFunc) HookCounter
- func (m *MockDB) Begin(context.Context, *sql.TxOptions) (db.Tx, error)
- func (m *MockDB) ClearHooks()
- func (m *MockDB) Exec(_ context.Context, query *db.Query) (db.Result, error)
- func (m *MockDB) Ping(context.Context) error
- func (m *MockDB) Query(_ context.Context, query *db.Query) (db.Rows, error)
- func (m *MockDB) QueryRow(_ context.Context, query *db.Query) db.Row
- func (m *MockDB) RemoveHook(queryName string)
- type QueryRowValuesFunc
- type QueryValuesFunc
- type ResultValuesFunc
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type HookCounter ¶
type MockDB ¶
type MockDB struct {
// contains filtered or unexported fields
}
func (*MockDB) AddHook ¶
func (m *MockDB) AddHook(queryName string, query QueryValuesFunc, queryRow QueryRowValuesFunc, result ResultValuesFunc) HookCounter
func (*MockDB) AddQueryHook ¶
func (m *MockDB) AddQueryHook(queryName string, queryFunc QueryValuesFunc) HookCounter
func (*MockDB) AddQueryResultHook ¶
func (m *MockDB) AddQueryResultHook(queryName string, resultFunc ResultValuesFunc) HookCounter
func (*MockDB) AddQueryRowHook ¶
func (m *MockDB) AddQueryRowHook(queryName string, queryRowFunc QueryRowValuesFunc) HookCounter
func (*MockDB) ClearHooks ¶
func (m *MockDB) ClearHooks()
func (*MockDB) RemoveHook ¶
type QueryRowValuesFunc ¶
type QueryRowValuesFunc func() []interface{}
QueryRowValuesFunc returns a single slice of column values
type QueryValuesFunc ¶
type QueryValuesFunc func() [][]interface{}
QueryValuesFunc returns a slice of many column values
type ResultValuesFunc ¶
ResultValuesFunc returns the last insert id and the number of rows affected
Click to show internal directories.
Click to hide internal directories.