mocks

package
v0.33.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository[T interface{}] struct {
	mock.Mock
}

Repository is an autogenerated mock type for the Repository type

func NewRepository

func NewRepository[T interface{}](t interface {
	mock.TestingT
	Cleanup(func())
}) *Repository[T]

NewRepository creates a new instance of Repository. 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 (*Repository[T]) EXPECT

func (_m *Repository[T]) EXPECT() *Repository_Expecter[T]

func (*Repository[T]) Query

func (_m *Repository[T]) Query(ctx context.Context, qb squirrel.SelectBuilder) ([]T, error)

Query provides a mock function with given fields: ctx, qb

func (*Repository[T]) QueryBuilder

func (_m *Repository[T]) QueryBuilder() squirrel.SelectBuilder

QueryBuilder provides a mock function with given fields:

func (*Repository[T]) QueryRows

func (_m *Repository[T]) QueryRows(ctx context.Context, sql string) (*sqlx.Rows, error)

QueryRows provides a mock function with given fields: ctx, sql

func (*Repository[T]) QuerySql

func (_m *Repository[T]) QuerySql(ctx context.Context, query string) ([]T, error)

QuerySql provides a mock function with given fields: ctx, query

type RepositoryRaw

type RepositoryRaw struct {
	mock.Mock
}

RepositoryRaw is an autogenerated mock type for the RepositoryRaw type

func NewRepositoryRaw

func NewRepositoryRaw(t interface {
	mock.TestingT
	Cleanup(func())
}) *RepositoryRaw

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

func (_m *RepositoryRaw) EXPECT() *RepositoryRaw_Expecter

func (*RepositoryRaw) QueryRows

func (_m *RepositoryRaw) QueryRows(ctx context.Context, sql string) (*sqlx.Rows, error)

QueryRows provides a mock function with given fields: ctx, sql

type RepositoryRaw_Expecter

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

func (*RepositoryRaw_Expecter) QueryRows

func (_e *RepositoryRaw_Expecter) QueryRows(ctx interface{}, sql interface{}) *RepositoryRaw_QueryRows_Call

QueryRows is a helper method to define mock.On call

  • ctx context.Context
  • sql string

type RepositoryRaw_QueryRows_Call

type RepositoryRaw_QueryRows_Call struct {
	*mock.Call
}

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

func (*RepositoryRaw_QueryRows_Call) Return

func (*RepositoryRaw_QueryRows_Call) Run

func (*RepositoryRaw_QueryRows_Call) RunAndReturn

type Repository_Expecter

type Repository_Expecter[T interface{}] struct {
	// contains filtered or unexported fields
}

func (*Repository_Expecter[T]) Query

func (_e *Repository_Expecter[T]) Query(ctx interface{}, qb interface{}) *Repository_Query_Call[T]

Query is a helper method to define mock.On call

  • ctx context.Context
  • qb squirrel.SelectBuilder

func (*Repository_Expecter[T]) QueryBuilder

func (_e *Repository_Expecter[T]) QueryBuilder() *Repository_QueryBuilder_Call[T]

QueryBuilder is a helper method to define mock.On call

func (*Repository_Expecter[T]) QueryRows

func (_e *Repository_Expecter[T]) QueryRows(ctx interface{}, sql interface{}) *Repository_QueryRows_Call[T]

QueryRows is a helper method to define mock.On call

  • ctx context.Context
  • sql string

func (*Repository_Expecter[T]) QuerySql

func (_e *Repository_Expecter[T]) QuerySql(ctx interface{}, query interface{}) *Repository_QuerySql_Call[T]

QuerySql is a helper method to define mock.On call

  • ctx context.Context
  • query string

type Repository_QueryBuilder_Call

type Repository_QueryBuilder_Call[T interface{}] struct {
	*mock.Call
}

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

func (*Repository_QueryBuilder_Call[T]) Return

func (*Repository_QueryBuilder_Call[T]) Run

func (*Repository_QueryBuilder_Call[T]) RunAndReturn

type Repository_QueryRows_Call

type Repository_QueryRows_Call[T interface{}] struct {
	*mock.Call
}

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

func (*Repository_QueryRows_Call[T]) Return

func (_c *Repository_QueryRows_Call[T]) Return(_a0 *sqlx.Rows, _a1 error) *Repository_QueryRows_Call[T]

func (*Repository_QueryRows_Call[T]) Run

func (_c *Repository_QueryRows_Call[T]) Run(run func(ctx context.Context, sql string)) *Repository_QueryRows_Call[T]

func (*Repository_QueryRows_Call[T]) RunAndReturn

func (_c *Repository_QueryRows_Call[T]) RunAndReturn(run func(context.Context, string) (*sqlx.Rows, error)) *Repository_QueryRows_Call[T]

type Repository_QuerySql_Call

type Repository_QuerySql_Call[T interface{}] struct {
	*mock.Call
}

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

func (*Repository_QuerySql_Call[T]) Return

func (_c *Repository_QuerySql_Call[T]) Return(_a0 []T, _a1 error) *Repository_QuerySql_Call[T]

func (*Repository_QuerySql_Call[T]) Run

func (_c *Repository_QuerySql_Call[T]) Run(run func(ctx context.Context, query string)) *Repository_QuerySql_Call[T]

func (*Repository_QuerySql_Call[T]) RunAndReturn

func (_c *Repository_QuerySql_Call[T]) RunAndReturn(run func(context.Context, string) ([]T, error)) *Repository_QuerySql_Call[T]

type Repository_Query_Call

type Repository_Query_Call[T interface{}] struct {
	*mock.Call
}

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

func (*Repository_Query_Call[T]) Return

func (_c *Repository_Query_Call[T]) Return(_a0 []T, _a1 error) *Repository_Query_Call[T]

func (*Repository_Query_Call[T]) Run

func (*Repository_Query_Call[T]) RunAndReturn

func (_c *Repository_Query_Call[T]) RunAndReturn(run func(context.Context, squirrel.SelectBuilder) ([]T, error)) *Repository_Query_Call[T]

Jump to

Keyboard shortcuts

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