mocks

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockDB

type MockDB struct {
	mock.Mock
}

MockDB is an autogenerated mock type for the DB type

func NewMockDB

func NewMockDB(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockDB

NewMockDB creates a new instance of MockDB. 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 (*MockDB) Close

func (_mock *MockDB) Close() error

Close provides a mock function for the type MockDB

func (*MockDB) EXPECT

func (_m *MockDB) EXPECT() *MockDB_Expecter

func (*MockDB) Exec

func (_mock *MockDB) Exec(sql string, args ...any) (in.Result, error)

Exec provides a mock function for the type MockDB

func (*MockDB) Prepare

func (_mock *MockDB) Prepare(sql string) (in.Stmt, error)

Prepare provides a mock function for the type MockDB

func (*MockDB) Query

func (_mock *MockDB) Query(sql string, args ...any) (in.Rows, error)

Query provides a mock function for the type MockDB

type MockDB_Close_Call

type MockDB_Close_Call struct {
	*mock.Call
}

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

func (*MockDB_Close_Call) Return

func (_c *MockDB_Close_Call) Return(err error) *MockDB_Close_Call

func (*MockDB_Close_Call) Run

func (_c *MockDB_Close_Call) Run(run func()) *MockDB_Close_Call

func (*MockDB_Close_Call) RunAndReturn

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

type MockDB_Exec_Call

type MockDB_Exec_Call struct {
	*mock.Call
}

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

func (*MockDB_Exec_Call) Return

func (_c *MockDB_Exec_Call) Return(result in.Result, err error) *MockDB_Exec_Call

func (*MockDB_Exec_Call) Run

func (_c *MockDB_Exec_Call) Run(run func(sql string, args ...any)) *MockDB_Exec_Call

func (*MockDB_Exec_Call) RunAndReturn

func (_c *MockDB_Exec_Call) RunAndReturn(run func(sql string, args ...any) (in.Result, error)) *MockDB_Exec_Call

type MockDB_Expecter

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

func (*MockDB_Expecter) Close

func (_e *MockDB_Expecter) Close() *MockDB_Close_Call

Close is a helper method to define mock.On call

func (*MockDB_Expecter) Exec

func (_e *MockDB_Expecter) Exec(sql interface{}, args ...interface{}) *MockDB_Exec_Call

Exec is a helper method to define mock.On call

  • sql string
  • args ...any

func (*MockDB_Expecter) Prepare

func (_e *MockDB_Expecter) Prepare(sql interface{}) *MockDB_Prepare_Call

Prepare is a helper method to define mock.On call

  • sql string

func (*MockDB_Expecter) Query

func (_e *MockDB_Expecter) Query(sql interface{}, args ...interface{}) *MockDB_Query_Call

Query is a helper method to define mock.On call

  • sql string
  • args ...any

type MockDB_Prepare_Call

type MockDB_Prepare_Call struct {
	*mock.Call
}

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

func (*MockDB_Prepare_Call) Return

func (_c *MockDB_Prepare_Call) Return(stmt in.Stmt, err error) *MockDB_Prepare_Call

func (*MockDB_Prepare_Call) Run

func (_c *MockDB_Prepare_Call) Run(run func(sql string)) *MockDB_Prepare_Call

func (*MockDB_Prepare_Call) RunAndReturn

func (_c *MockDB_Prepare_Call) RunAndReturn(run func(sql string) (in.Stmt, error)) *MockDB_Prepare_Call

type MockDB_Query_Call

type MockDB_Query_Call struct {
	*mock.Call
}

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

func (*MockDB_Query_Call) Return

func (_c *MockDB_Query_Call) Return(rows in.Rows, err error) *MockDB_Query_Call

func (*MockDB_Query_Call) Run

func (_c *MockDB_Query_Call) Run(run func(sql string, args ...any)) *MockDB_Query_Call

func (*MockDB_Query_Call) RunAndReturn

func (_c *MockDB_Query_Call) RunAndReturn(run func(sql string, args ...any) (in.Rows, error)) *MockDB_Query_Call

type MockResult

type MockResult struct {
	mock.Mock
}

MockResult is an autogenerated mock type for the Result type

func NewMockResult

func NewMockResult(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockResult

NewMockResult creates a new instance of MockResult. 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 (*MockResult) EXPECT

func (_m *MockResult) EXPECT() *MockResult_Expecter

func (*MockResult) LastInsertId

func (_mock *MockResult) LastInsertId() (int64, error)

LastInsertId provides a mock function for the type MockResult

func (*MockResult) RowsAffected

func (_mock *MockResult) RowsAffected() (int64, error)

RowsAffected provides a mock function for the type MockResult

type MockResult_Expecter

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

func (*MockResult_Expecter) LastInsertId

LastInsertId is a helper method to define mock.On call

func (*MockResult_Expecter) RowsAffected

RowsAffected is a helper method to define mock.On call

type MockResult_LastInsertId_Call

type MockResult_LastInsertId_Call struct {
	*mock.Call
}

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

func (*MockResult_LastInsertId_Call) Return

func (*MockResult_LastInsertId_Call) Run

func (*MockResult_LastInsertId_Call) RunAndReturn

func (_c *MockResult_LastInsertId_Call) RunAndReturn(run func() (int64, error)) *MockResult_LastInsertId_Call

type MockResult_RowsAffected_Call

type MockResult_RowsAffected_Call struct {
	*mock.Call
}

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

func (*MockResult_RowsAffected_Call) Return

func (*MockResult_RowsAffected_Call) Run

func (*MockResult_RowsAffected_Call) RunAndReturn

func (_c *MockResult_RowsAffected_Call) RunAndReturn(run func() (int64, error)) *MockResult_RowsAffected_Call

type MockRows

type MockRows struct {
	mock.Mock
}

MockRows is an autogenerated mock type for the Rows type

func NewMockRows

func NewMockRows(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockRows

NewMockRows creates a new instance of MockRows. 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 (*MockRows) Close

func (_mock *MockRows) Close() error

Close provides a mock function for the type MockRows

func (*MockRows) Columns

func (_mock *MockRows) Columns() ([]string, error)

Columns provides a mock function for the type MockRows

func (*MockRows) EXPECT

func (_m *MockRows) EXPECT() *MockRows_Expecter

func (*MockRows) Err

func (_mock *MockRows) Err() error

Err provides a mock function for the type MockRows

func (*MockRows) Next

func (_mock *MockRows) Next() bool

Next provides a mock function for the type MockRows

func (*MockRows) Scan

func (_mock *MockRows) Scan(dest ...any) error

Scan provides a mock function for the type MockRows

type MockRows_Close_Call

type MockRows_Close_Call struct {
	*mock.Call
}

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

func (*MockRows_Close_Call) Return

func (*MockRows_Close_Call) Run

func (_c *MockRows_Close_Call) Run(run func()) *MockRows_Close_Call

func (*MockRows_Close_Call) RunAndReturn

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

type MockRows_Columns_Call

type MockRows_Columns_Call struct {
	*mock.Call
}

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

func (*MockRows_Columns_Call) Return

func (_c *MockRows_Columns_Call) Return(strings []string, err error) *MockRows_Columns_Call

func (*MockRows_Columns_Call) Run

func (_c *MockRows_Columns_Call) Run(run func()) *MockRows_Columns_Call

func (*MockRows_Columns_Call) RunAndReturn

func (_c *MockRows_Columns_Call) RunAndReturn(run func() ([]string, error)) *MockRows_Columns_Call

type MockRows_Err_Call

type MockRows_Err_Call struct {
	*mock.Call
}

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

func (*MockRows_Err_Call) Return

func (_c *MockRows_Err_Call) Return(err error) *MockRows_Err_Call

func (*MockRows_Err_Call) Run

func (_c *MockRows_Err_Call) Run(run func()) *MockRows_Err_Call

func (*MockRows_Err_Call) RunAndReturn

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

type MockRows_Expecter

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

func (*MockRows_Expecter) Close

Close is a helper method to define mock.On call

func (*MockRows_Expecter) Columns

Columns is a helper method to define mock.On call

func (*MockRows_Expecter) Err

Err is a helper method to define mock.On call

func (*MockRows_Expecter) Next

Next is a helper method to define mock.On call

func (*MockRows_Expecter) Scan

func (_e *MockRows_Expecter) Scan(dest ...interface{}) *MockRows_Scan_Call

Scan is a helper method to define mock.On call

  • dest ...any

type MockRows_Next_Call

type MockRows_Next_Call struct {
	*mock.Call
}

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

func (*MockRows_Next_Call) Return

func (*MockRows_Next_Call) Run

func (_c *MockRows_Next_Call) Run(run func()) *MockRows_Next_Call

func (*MockRows_Next_Call) RunAndReturn

func (_c *MockRows_Next_Call) RunAndReturn(run func() bool) *MockRows_Next_Call

type MockRows_Scan_Call

type MockRows_Scan_Call struct {
	*mock.Call
}

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

func (*MockRows_Scan_Call) Return

func (_c *MockRows_Scan_Call) Return(err error) *MockRows_Scan_Call

func (*MockRows_Scan_Call) Run

func (_c *MockRows_Scan_Call) Run(run func(dest ...any)) *MockRows_Scan_Call

func (*MockRows_Scan_Call) RunAndReturn

func (_c *MockRows_Scan_Call) RunAndReturn(run func(dest ...any) error) *MockRows_Scan_Call

type MockStmt

type MockStmt struct {
	mock.Mock
}

MockStmt is an autogenerated mock type for the Stmt type

func NewMockStmt

func NewMockStmt(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockStmt

NewMockStmt creates a new instance of MockStmt. 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 (*MockStmt) Close

func (_mock *MockStmt) Close() error

Close provides a mock function for the type MockStmt

func (*MockStmt) EXPECT

func (_m *MockStmt) EXPECT() *MockStmt_Expecter

func (*MockStmt) Exec

func (_mock *MockStmt) Exec(args ...any) (in.Result, error)

Exec provides a mock function for the type MockStmt

func (*MockStmt) NumInput

func (_mock *MockStmt) NumInput() int

NumInput provides a mock function for the type MockStmt

func (*MockStmt) Query

func (_mock *MockStmt) Query(args ...any) (in.Rows, error)

Query provides a mock function for the type MockStmt

type MockStmt_Close_Call

type MockStmt_Close_Call struct {
	*mock.Call
}

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

func (*MockStmt_Close_Call) Return

func (*MockStmt_Close_Call) Run

func (_c *MockStmt_Close_Call) Run(run func()) *MockStmt_Close_Call

func (*MockStmt_Close_Call) RunAndReturn

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

type MockStmt_Exec_Call

type MockStmt_Exec_Call struct {
	*mock.Call
}

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

func (*MockStmt_Exec_Call) Return

func (_c *MockStmt_Exec_Call) Return(result in.Result, err error) *MockStmt_Exec_Call

func (*MockStmt_Exec_Call) Run

func (_c *MockStmt_Exec_Call) Run(run func(args ...any)) *MockStmt_Exec_Call

func (*MockStmt_Exec_Call) RunAndReturn

func (_c *MockStmt_Exec_Call) RunAndReturn(run func(args ...any) (in.Result, error)) *MockStmt_Exec_Call

type MockStmt_Expecter

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

func (*MockStmt_Expecter) Close

Close is a helper method to define mock.On call

func (*MockStmt_Expecter) Exec

func (_e *MockStmt_Expecter) Exec(args ...interface{}) *MockStmt_Exec_Call

Exec is a helper method to define mock.On call

  • args ...any

func (*MockStmt_Expecter) NumInput

func (_e *MockStmt_Expecter) NumInput() *MockStmt_NumInput_Call

NumInput is a helper method to define mock.On call

func (*MockStmt_Expecter) Query

func (_e *MockStmt_Expecter) Query(args ...interface{}) *MockStmt_Query_Call

Query is a helper method to define mock.On call

  • args ...any

type MockStmt_NumInput_Call

type MockStmt_NumInput_Call struct {
	*mock.Call
}

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

func (*MockStmt_NumInput_Call) Return

func (*MockStmt_NumInput_Call) Run

func (_c *MockStmt_NumInput_Call) Run(run func()) *MockStmt_NumInput_Call

func (*MockStmt_NumInput_Call) RunAndReturn

func (_c *MockStmt_NumInput_Call) RunAndReturn(run func() int) *MockStmt_NumInput_Call

type MockStmt_Query_Call

type MockStmt_Query_Call struct {
	*mock.Call
}

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

func (*MockStmt_Query_Call) Return

func (_c *MockStmt_Query_Call) Return(rows in.Rows, err error) *MockStmt_Query_Call

func (*MockStmt_Query_Call) Run

func (_c *MockStmt_Query_Call) Run(run func(args ...any)) *MockStmt_Query_Call

func (*MockStmt_Query_Call) RunAndReturn

func (_c *MockStmt_Query_Call) RunAndReturn(run func(args ...any) (in.Rows, error)) *MockStmt_Query_Call

Jump to

Keyboard shortcuts

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