Documentation ¶
Index ¶
- Constants
- Variables
- type AnythingOfTypeArgument
- type DB
- func (_m *DB) Begin() (record.Txer, error)
- func (_m *DB) BeginContext(ctx context.Context, opts *sql.TxOptions) (record.Txer, error)
- func (_m *DB) Close() error
- func (_m *DB) Config() *record.Config
- func (_m *DB) Conn(ctx context.Context) (*sql.Conn, error)
- func (_m *DB) Connect() error
- func (_m *DB) ConnectDefaultDB() error
- func (_m *DB) CreateDB(database string) error
- func (_m *DB) Driver() driver.Driver
- func (_m *DB) DriverName() string
- func (_m *DB) DropDB(database string) error
- func (_m *DB) DumpSchema(database string) error
- func (_m *DB) Exec(query string, args ...interface{}) (sql.Result, error)
- func (_m *DB) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (_m *DB) GenerateMigration(name string, target string, tx bool) error
- func (_m *DB) Get(dest interface{}, query string, args ...interface{}) error
- func (_m *DB) GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error
- func (_m *DB) Migrate() error
- func (_m *DB) MigrateStatus() ([][]string, error)
- func (_m *DB) NamedExec(query string, arg interface{}) (sql.Result, error)
- func (_m *DB) NamedExecContext(ctx context.Context, query string, arg interface{}) (sql.Result, error)
- func (_m *DB) NamedQuery(query string, arg interface{}) (*record.Rows, error)
- func (_m *DB) NamedQueryContext(ctx context.Context, query string, arg interface{}) (*record.Rows, error)
- func (_m *DB) Ping() error
- func (_m *DB) PingContext(ctx context.Context) error
- func (_m *DB) Prepare(query string) (*record.Stmt, error)
- func (_m *DB) PrepareContext(ctx context.Context, query string) (*record.Stmt, error)
- func (_m *DB) PrepareNamed(query string) (*record.NamedStmt, error)
- func (_m *DB) PrepareNamedContext(ctx context.Context, query string) (*record.NamedStmt, error)
- func (_m *DB) Query(query string, args ...interface{}) (*record.Rows, error)
- func (_m *DB) QueryContext(ctx context.Context, query string, args ...interface{}) (*record.Rows, error)
- func (_m *DB) QueryRow(query string, args ...interface{}) *record.Row
- func (_m *DB) QueryRowContext(ctx context.Context, query string, args ...interface{}) *record.Row
- func (_m *DB) Rebind(query string) string
- func (_m *DB) RegisterMigration(up func(record.DBer) error, down func(record.DBer) error, args ...string) error
- func (_m *DB) RegisterMigrationTx(upTx func(record.Txer) error, downTx func(record.Txer) error, args ...string) error
- func (_m *DB) RegisterSeedTx(seed func(record.Txer) error)
- func (_m *DB) Rollback() error
- func (_m *DB) Schema() string
- func (_m *DB) Seed() error
- func (_m *DB) Select(dest interface{}, query string, args ...interface{}) error
- func (_m *DB) SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error
- func (_m *DB) SetConnMaxLifetime(d time.Duration)
- func (_m *DB) SetMaxIdleConns(n int)
- func (_m *DB) SetMaxOpenConns(n int)
- func (_m *DB) SetSchema(schema string)
- func (_m *DB) Stats() sql.DBStats
- type IsTypeArgument
- type Mock
- type Model
- func (_m *Model) All() record.Modeler
- func (_m *Model) AttrByDBColumn(dbColumn string) *record.ModelAttr
- func (_m *Model) Begin() error
- func (_m *Model) BeginContext(ctx context.Context, opts *sql.TxOptions) error
- func (_m *Model) Commit() []error
- func (_m *Model) Count() record.Modeler
- func (_m *Model) Create() record.Modeler
- func (_m *Model) Delete() record.Modeler
- func (_m *Model) DeleteAll() record.Modeler
- func (_m *Model) Exec(opts ...record.ExecOption) (int64, []error)
- func (_m *Model) Find() record.Modeler
- func (_m *Model) Group(group string) record.Modeler
- func (_m *Model) Having(having string, args ...interface{}) record.Modeler
- func (_m *Model) Join(join string, args ...interface{}) record.Modeler
- func (_m *Model) Limit(limit int) record.Modeler
- func (_m *Model) Offset(offset int) record.Modeler
- func (_m *Model) Order(order string) record.Modeler
- func (_m *Model) PrimaryKeys() []string
- func (_m *Model) Rollback() []error
- func (_m *Model) SQL() string
- func (_m *Model) Scan(dest interface{}) record.Modeler
- func (_m *Model) Select(columns string) record.Modeler
- func (_m *Model) Tx() record.Txer
- func (_m *Model) Update() record.Modeler
- func (_m *Model) UpdateAll(set string, args ...interface{}) record.Modeler
- func (_m *Model) Where(condition string, args ...interface{}) record.Modeler
- type Stmt
- func (_m *Stmt) Exec(args ...interface{}) (sql.Result, error)
- func (_m *Stmt) ExecContext(ctx context.Context, args ...interface{}) (sql.Result, error)
- func (_m *Stmt) Query(args ...interface{}) (*record.Rows, error)
- func (_m *Stmt) QueryContext(ctx context.Context, args ...interface{}) (*record.Rows, error)
- func (_m *Stmt) QueryRow(args ...interface{}) *record.Row
- func (_m *Stmt) QueryRowContext(ctx context.Context, args ...interface{}) *record.Row
- type Tx
- func (_m *Tx) Commit() error
- func (_m *Tx) Exec(query string, args ...interface{}) (sql.Result, error)
- func (_m *Tx) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (_m *Tx) Get(dest interface{}, query string, args ...interface{}) error
- func (_m *Tx) GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error
- func (_m *Tx) NamedExec(query string, arg interface{}) (sql.Result, error)
- func (_m *Tx) NamedExecContext(ctx context.Context, query string, arg interface{}) (sql.Result, error)
- func (_m *Tx) NamedQuery(query string, arg interface{}) (*record.Rows, error)
- func (_m *Tx) NamedQueryContext(ctx context.Context, query string, arg interface{}) (*record.Rows, error)
- func (_m *Tx) Prepare(query string) (*record.Stmt, error)
- func (_m *Tx) PrepareContext(ctx context.Context, query string) (*record.Stmt, error)
- func (_m *Tx) PrepareNamed(query string) (*record.NamedStmt, error)
- func (_m *Tx) PrepareNamedContext(ctx context.Context, query string) (*record.NamedStmt, error)
- func (_m *Tx) Query(query string, args ...interface{}) (*record.Rows, error)
- func (_m *Tx) QueryContext(ctx context.Context, query string, args ...interface{}) (*record.Rows, error)
- func (_m *Tx) QueryRow(query string, args ...interface{}) *record.Row
- func (_m *Tx) QueryRowContext(ctx context.Context, query string, args ...interface{}) *record.Row
- func (_m *Tx) Rollback() error
- func (_m *Tx) Select(dest interface{}, query string, args ...interface{}) error
- func (_m *Tx) SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error
- func (_m *Tx) Stmt(stmt *record.Stmt) *record.Stmt
- func (_m *Tx) StmtContext(ctx context.Context, stmt *record.Stmt) *record.Stmt
Constants ¶
const ( // Anything is used in Diff and Assert when the argument being tested // shouldn't be taken into consideration. Anything = mock.Anything )
Variables ¶
var ( // AnythingOfType returns an AnythingOfTypeArgument object containing the // name of the type to check for. AnythingOfType = mock.AnythingOfType // IsType returns an IsTypeArgument object containing the type to check for. // You can provide a zero-value of the type to check. This is an alternative // to AnythingOfType. IsType = mock.IsType )
Functions ¶
This section is empty.
Types ¶
type AnythingOfTypeArgument ¶
type AnythingOfTypeArgument = mock.AnythingOfTypeArgument
AnythingOfTypeArgument is a string that contains the type of an argument for use when type checking.
type DB ¶
DB is an autogenerated mock type for the DBer type
func (*DB) BeginContext ¶
BeginContext provides a mock function with given fields: ctx, opts
func (*DB) ConnectDefaultDB ¶
ConnectDefaultDB provides a mock function with given fields:
func (*DB) DriverName ¶
DriverName provides a mock function with given fields:
func (*DB) DumpSchema ¶
DumpSchema provides a mock function with given fields: database
func (*DB) ExecContext ¶
func (_m *DB) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
ExecContext provides a mock function with given fields: ctx, query, args
func (*DB) GenerateMigration ¶
GenerateMigration provides a mock function with given fields: name, target, tx
func (*DB) GetContext ¶
func (_m *DB) GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error
GetContext provides a mock function with given fields: ctx, dest, query, args
func (*DB) MigrateStatus ¶
MigrateStatus provides a mock function with given fields:
func (*DB) NamedExecContext ¶
func (_m *DB) NamedExecContext(ctx context.Context, query string, arg interface{}) (sql.Result, error)
NamedExecContext provides a mock function with given fields: ctx, query, arg
func (*DB) NamedQuery ¶
NamedQuery provides a mock function with given fields: query, arg
func (*DB) NamedQueryContext ¶
func (_m *DB) NamedQueryContext(ctx context.Context, query string, arg interface{}) (*record.Rows, error)
NamedQueryContext provides a mock function with given fields: ctx, query, arg
func (*DB) PingContext ¶
PingContext provides a mock function with given fields: ctx
func (*DB) PrepareContext ¶
PrepareContext provides a mock function with given fields: ctx, query
func (*DB) PrepareNamed ¶
PrepareNamed provides a mock function with given fields: query
func (*DB) PrepareNamedContext ¶
PrepareNamedContext provides a mock function with given fields: ctx, query
func (*DB) QueryContext ¶
func (_m *DB) QueryContext(ctx context.Context, query string, args ...interface{}) (*record.Rows, error)
QueryContext provides a mock function with given fields: ctx, query, args
func (*DB) QueryRowContext ¶
QueryRowContext provides a mock function with given fields: ctx, query, args
func (*DB) RegisterMigration ¶
func (_m *DB) RegisterMigration(up func(record.DBer) error, down func(record.DBer) error, args ...string) error
RegisterMigration provides a mock function with given fields: up, down, args
func (*DB) RegisterMigrationTx ¶
func (_m *DB) RegisterMigrationTx(upTx func(record.Txer) error, downTx func(record.Txer) error, args ...string) error
RegisterMigrationTx provides a mock function with given fields: upTx, downTx, args
func (*DB) RegisterSeedTx ¶
RegisterSeedTx provides a mock function with given fields: seed
func (*DB) SelectContext ¶
func (_m *DB) SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error
SelectContext provides a mock function with given fields: ctx, dest, query, args
func (*DB) SetConnMaxLifetime ¶
SetConnMaxLifetime provides a mock function with given fields: d
func (*DB) SetMaxIdleConns ¶
SetMaxIdleConns provides a mock function with given fields: n
func (*DB) SetMaxOpenConns ¶
SetMaxOpenConns provides a mock function with given fields: n
type IsTypeArgument ¶
type IsTypeArgument = mock.IsTypeArgument
IsTypeArgument is a struct that contains the type of an argument for use when type checking. This is an alternative to AnythingOfType.
type Model ¶
Model is an autogenerated mock type for the Modeler type
func NewModel ¶
func NewModel(mockedDest interface{}) (func(dest interface{}, opts ...record.ModelOption) record.Modeler, *Model)
NewModel initializes a test model that is useful for testing purpose.
func (*Model) AttrByDBColumn ¶
AttrByDBColumn provides a mock function with given fields: dbColumn
func (*Model) BeginContext ¶
BeginContext provides a mock function with given fields: ctx, opts
func (*Model) Exec ¶
func (_m *Model) Exec(opts ...record.ExecOption) (int64, []error)
Exec provides a mock function with given fields: opts
func (*Model) PrimaryKeys ¶
PrimaryKeys provides a mock function with given fields:
type Stmt ¶
Stmt is an autogenerated mock type for the Stmter type
func (*Stmt) ExecContext ¶
ExecContext provides a mock function with given fields: ctx, args
func (*Stmt) QueryContext ¶
QueryContext provides a mock function with given fields: ctx, args
type Tx ¶
Tx is an autogenerated mock type for the Txer type
func (*Tx) ExecContext ¶
func (_m *Tx) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
ExecContext provides a mock function with given fields: ctx, query, args
func (*Tx) GetContext ¶
func (_m *Tx) GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error
GetContext provides a mock function with given fields: ctx, dest, query, args
func (*Tx) NamedExecContext ¶
func (_m *Tx) NamedExecContext(ctx context.Context, query string, arg interface{}) (sql.Result, error)
NamedExecContext provides a mock function with given fields: ctx, query, arg
func (*Tx) NamedQuery ¶
NamedQuery provides a mock function with given fields: query, arg
func (*Tx) NamedQueryContext ¶
func (_m *Tx) NamedQueryContext(ctx context.Context, query string, arg interface{}) (*record.Rows, error)
NamedQueryContext provides a mock function with given fields: ctx, query, arg
func (*Tx) PrepareContext ¶
PrepareContext provides a mock function with given fields: ctx, query
func (*Tx) PrepareNamed ¶
PrepareNamed provides a mock function with given fields: query
func (*Tx) PrepareNamedContext ¶
PrepareNamedContext provides a mock function with given fields: ctx, query
func (*Tx) QueryContext ¶
func (_m *Tx) QueryContext(ctx context.Context, query string, args ...interface{}) (*record.Rows, error)
QueryContext provides a mock function with given fields: ctx, query, args
func (*Tx) QueryRowContext ¶
QueryRowContext provides a mock function with given fields: ctx, query, args
func (*Tx) SelectContext ¶
func (_m *Tx) SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error
SelectContext provides a mock function with given fields: ctx, dest, query, args