mocks

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	mock.Mock
}

DB is an autogenerated mock type for the DB type

func NewDB

func NewDB(t interface {
	mock.TestingT
	Cleanup(func())
}) *DB

NewDB creates a new instance of DB. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*DB) BeginTxx

func (_m *DB) BeginTxx(ctx context.Context, opts *sql.TxOptions) (storagesql.Tx, error)

BeginTxx provides a mock function with given fields: ctx, opts

func (*DB) Close

func (_m *DB) Close()

Close provides a mock function with no fields

func (*DB) ConnectContext

func (_m *DB) ConnectContext(ctx context.Context, driverName string, dataSourceName string) (*sqlx.DB, error)

ConnectContext provides a mock function with given fields: ctx, driverName, dataSourceName

func (*DB) EXPECT

func (_m *DB) EXPECT() *DB_Expecter

type DB_BeginTxx_Call

type DB_BeginTxx_Call struct {
	*mock.Call
}

DB_BeginTxx_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BeginTxx'

func (*DB_BeginTxx_Call) Return

func (_c *DB_BeginTxx_Call) Return(_a0 storagesql.Tx, _a1 error) *DB_BeginTxx_Call

func (*DB_BeginTxx_Call) Run

func (_c *DB_BeginTxx_Call) Run(run func(ctx context.Context, opts *sql.TxOptions)) *DB_BeginTxx_Call

func (*DB_BeginTxx_Call) RunAndReturn

func (_c *DB_BeginTxx_Call) RunAndReturn(run func(context.Context, *sql.TxOptions) (storagesql.Tx, error)) *DB_BeginTxx_Call

type DB_Close_Call

type DB_Close_Call struct {
	*mock.Call
}

DB_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'

func (*DB_Close_Call) Return

func (_c *DB_Close_Call) Return() *DB_Close_Call

func (*DB_Close_Call) Run

func (_c *DB_Close_Call) Run(run func()) *DB_Close_Call

func (*DB_Close_Call) RunAndReturn

func (_c *DB_Close_Call) RunAndReturn(run func()) *DB_Close_Call

type DB_ConnectContext_Call

type DB_ConnectContext_Call struct {
	*mock.Call
}

DB_ConnectContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConnectContext'

func (*DB_ConnectContext_Call) Return

func (*DB_ConnectContext_Call) Run

func (_c *DB_ConnectContext_Call) Run(run func(ctx context.Context, driverName string, dataSourceName string)) *DB_ConnectContext_Call

func (*DB_ConnectContext_Call) RunAndReturn

type DB_Expecter

type DB_Expecter struct {
	// contains filtered or unexported fields
}

func (*DB_Expecter) BeginTxx

func (_e *DB_Expecter) BeginTxx(ctx interface{}, opts interface{}) *DB_BeginTxx_Call

BeginTxx is a helper method to define mock.On call

  • ctx context.Context
  • opts *sql.TxOptions

func (*DB_Expecter) Close

func (_e *DB_Expecter) Close() *DB_Close_Call

Close is a helper method to define mock.On call

func (*DB_Expecter) ConnectContext

func (_e *DB_Expecter) ConnectContext(ctx interface{}, driverName interface{}, dataSourceName interface{}) *DB_ConnectContext_Call

ConnectContext is a helper method to define mock.On call

  • ctx context.Context
  • driverName string
  • dataSourceName string

type Tx

type Tx struct {
	mock.Mock
}

Tx is an autogenerated mock type for the Tx type

func NewTx

func NewTx(t interface {
	mock.TestingT
	Cleanup(func())
}) *Tx

NewTx creates a new instance of Tx. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*Tx) Commit

func (_m *Tx) Commit() error

Commit provides a mock function with no fields

func (*Tx) EXPECT

func (_m *Tx) EXPECT() *Tx_Expecter

func (*Tx) ExecContext

func (_m *Tx) ExecContext(ctx context.Context, query string, args ...interface{}) (databasesql.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{}) (databasesql.Result, error)

NamedExecContext provides a mock function with given fields: ctx, query, arg

func (*Tx) Rollback

func (_m *Tx) Rollback() error

Rollback provides a mock function with no fields

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

type Tx_Commit_Call

type Tx_Commit_Call struct {
	*mock.Call
}

Tx_Commit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Commit'

func (*Tx_Commit_Call) Return

func (_c *Tx_Commit_Call) Return(_a0 error) *Tx_Commit_Call

func (*Tx_Commit_Call) Run

func (_c *Tx_Commit_Call) Run(run func()) *Tx_Commit_Call

func (*Tx_Commit_Call) RunAndReturn

func (_c *Tx_Commit_Call) RunAndReturn(run func() error) *Tx_Commit_Call

type Tx_ExecContext_Call

type Tx_ExecContext_Call struct {
	*mock.Call
}

Tx_ExecContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExecContext'

func (*Tx_ExecContext_Call) Return

func (*Tx_ExecContext_Call) Run

func (_c *Tx_ExecContext_Call) Run(run func(ctx context.Context, query string, args ...interface{})) *Tx_ExecContext_Call

func (*Tx_ExecContext_Call) RunAndReturn

func (_c *Tx_ExecContext_Call) RunAndReturn(run func(context.Context, string, ...interface{}) (databasesql.Result, error)) *Tx_ExecContext_Call

type Tx_Expecter

type Tx_Expecter struct {
	// contains filtered or unexported fields
}

func (*Tx_Expecter) Commit

func (_e *Tx_Expecter) Commit() *Tx_Commit_Call

Commit is a helper method to define mock.On call

func (*Tx_Expecter) ExecContext

func (_e *Tx_Expecter) ExecContext(ctx interface{}, query interface{}, args ...interface{}) *Tx_ExecContext_Call

ExecContext is a helper method to define mock.On call

  • ctx context.Context
  • query string
  • args ...interface{}

func (*Tx_Expecter) GetContext

func (_e *Tx_Expecter) GetContext(ctx interface{}, dest interface{}, query interface{}, args ...interface{}) *Tx_GetContext_Call

GetContext is a helper method to define mock.On call

  • ctx context.Context
  • dest interface{}
  • query string
  • args ...interface{}

func (*Tx_Expecter) NamedExecContext

func (_e *Tx_Expecter) NamedExecContext(ctx interface{}, query interface{}, arg interface{}) *Tx_NamedExecContext_Call

NamedExecContext is a helper method to define mock.On call

  • ctx context.Context
  • query string
  • arg interface{}

func (*Tx_Expecter) Rollback

func (_e *Tx_Expecter) Rollback() *Tx_Rollback_Call

Rollback is a helper method to define mock.On call

func (*Tx_Expecter) SelectContext

func (_e *Tx_Expecter) SelectContext(ctx interface{}, dest interface{}, query interface{}, args ...interface{}) *Tx_SelectContext_Call

SelectContext is a helper method to define mock.On call

  • ctx context.Context
  • dest interface{}
  • query string
  • args ...interface{}

type Tx_GetContext_Call

type Tx_GetContext_Call struct {
	*mock.Call
}

Tx_GetContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetContext'

func (*Tx_GetContext_Call) Return

func (_c *Tx_GetContext_Call) Return(_a0 error) *Tx_GetContext_Call

func (*Tx_GetContext_Call) Run

func (_c *Tx_GetContext_Call) Run(run func(ctx context.Context, dest interface{}, query string, args ...interface{})) *Tx_GetContext_Call

func (*Tx_GetContext_Call) RunAndReturn

func (_c *Tx_GetContext_Call) RunAndReturn(run func(context.Context, interface{}, string, ...interface{}) error) *Tx_GetContext_Call

type Tx_NamedExecContext_Call

type Tx_NamedExecContext_Call struct {
	*mock.Call
}

Tx_NamedExecContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NamedExecContext'

func (*Tx_NamedExecContext_Call) Return

func (*Tx_NamedExecContext_Call) Run

func (_c *Tx_NamedExecContext_Call) Run(run func(ctx context.Context, query string, arg interface{})) *Tx_NamedExecContext_Call

func (*Tx_NamedExecContext_Call) RunAndReturn

func (_c *Tx_NamedExecContext_Call) RunAndReturn(run func(context.Context, string, interface{}) (databasesql.Result, error)) *Tx_NamedExecContext_Call

type Tx_Rollback_Call

type Tx_Rollback_Call struct {
	*mock.Call
}

Tx_Rollback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Rollback'

func (*Tx_Rollback_Call) Return

func (_c *Tx_Rollback_Call) Return(_a0 error) *Tx_Rollback_Call

func (*Tx_Rollback_Call) Run

func (_c *Tx_Rollback_Call) Run(run func()) *Tx_Rollback_Call

func (*Tx_Rollback_Call) RunAndReturn

func (_c *Tx_Rollback_Call) RunAndReturn(run func() error) *Tx_Rollback_Call

type Tx_SelectContext_Call

type Tx_SelectContext_Call struct {
	*mock.Call
}

Tx_SelectContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SelectContext'

func (*Tx_SelectContext_Call) Return

func (*Tx_SelectContext_Call) Run

func (_c *Tx_SelectContext_Call) Run(run func(ctx context.Context, dest interface{}, query string, args ...interface{})) *Tx_SelectContext_Call

func (*Tx_SelectContext_Call) RunAndReturn

func (_c *Tx_SelectContext_Call) RunAndReturn(run func(context.Context, interface{}, string, ...interface{}) error) *Tx_SelectContext_Call

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL