mockrepository

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	mock.Mock
}

Connection is an autogenerated mock type for the Connection type

func NewConnection

func NewConnection(t interface {
	mock.TestingT
	Cleanup(func())
}) *Connection

NewConnection creates a new instance of Connection. 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 (*Connection) Close added in v1.2.0

func (_m *Connection) Close() error

Close provides a mock function with no fields

func (*Connection) DSN

func (_m *Connection) DSN() string

DSN provides a mock function with no fields

func (*Connection) Driver

func (_m *Connection) Driver() connection.Driver

Driver provides a mock function with no fields

func (*Connection) EXPECT

func (_m *Connection) EXPECT() *Connection_Expecter

func (*Connection) ExecContext

func (_m *Connection) ExecContext(ctx context.Context, query string, args ...any) (sqlex.Result, error)

ExecContext provides a mock function with given fields: ctx, query, args

func (*Connection) Ping

func (_m *Connection) Ping() error

Ping provides a mock function with no fields

func (*Connection) QueryContext

func (_m *Connection) QueryContext(ctx context.Context, query string, args ...any) (sqlex.Rows, error)

QueryContext provides a mock function with given fields: ctx, query, args

func (*Connection) Transaction

func (_m *Connection) Transaction(ctx context.Context, txFn func(context.Context) error) error

Transaction provides a mock function with given fields: ctx, txFn

type Connection_Close_Call added in v1.2.0

type Connection_Close_Call struct {
	*mock.Call
}

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

func (*Connection_Close_Call) Return added in v1.2.0

func (*Connection_Close_Call) Run added in v1.2.0

func (_c *Connection_Close_Call) Run(run func()) *Connection_Close_Call

func (*Connection_Close_Call) RunAndReturn added in v1.2.0

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

type Connection_DSN_Call

type Connection_DSN_Call struct {
	*mock.Call
}

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

func (*Connection_DSN_Call) Return

func (*Connection_DSN_Call) Run

func (_c *Connection_DSN_Call) Run(run func()) *Connection_DSN_Call

func (*Connection_DSN_Call) RunAndReturn

func (_c *Connection_DSN_Call) RunAndReturn(run func() string) *Connection_DSN_Call

type Connection_Driver_Call

type Connection_Driver_Call struct {
	*mock.Call
}

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

func (*Connection_Driver_Call) Return

func (*Connection_Driver_Call) Run

func (_c *Connection_Driver_Call) Run(run func()) *Connection_Driver_Call

func (*Connection_Driver_Call) RunAndReturn

func (_c *Connection_Driver_Call) RunAndReturn(run func() connection.Driver) *Connection_Driver_Call

type Connection_ExecContext_Call

type Connection_ExecContext_Call struct {
	*mock.Call
}

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

func (*Connection_ExecContext_Call) Return

func (*Connection_ExecContext_Call) Run

func (_c *Connection_ExecContext_Call) Run(run func(ctx context.Context, query string, args ...any)) *Connection_ExecContext_Call

func (*Connection_ExecContext_Call) RunAndReturn

type Connection_Expecter

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

func (*Connection_Expecter) Close added in v1.2.0

Close is a helper method to define mock.On call

func (*Connection_Expecter) DSN

DSN is a helper method to define mock.On call

func (*Connection_Expecter) Driver

Driver is a helper method to define mock.On call

func (*Connection_Expecter) ExecContext

func (_e *Connection_Expecter) ExecContext(ctx interface{}, query interface{}, args ...interface{}) *Connection_ExecContext_Call

ExecContext is a helper method to define mock.On call

  • ctx context.Context
  • query string
  • args ...any

func (*Connection_Expecter) Ping

Ping is a helper method to define mock.On call

func (*Connection_Expecter) QueryContext

func (_e *Connection_Expecter) QueryContext(ctx interface{}, query interface{}, args ...interface{}) *Connection_QueryContext_Call

QueryContext is a helper method to define mock.On call

  • ctx context.Context
  • query string
  • args ...any

func (*Connection_Expecter) Transaction

func (_e *Connection_Expecter) Transaction(ctx interface{}, txFn interface{}) *Connection_Transaction_Call

Transaction is a helper method to define mock.On call

  • ctx context.Context
  • txFn func(context.Context) error

type Connection_Ping_Call

type Connection_Ping_Call struct {
	*mock.Call
}

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

func (*Connection_Ping_Call) Return

func (*Connection_Ping_Call) Run

func (_c *Connection_Ping_Call) Run(run func()) *Connection_Ping_Call

func (*Connection_Ping_Call) RunAndReturn

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

type Connection_QueryContext_Call

type Connection_QueryContext_Call struct {
	*mock.Call
}

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

func (*Connection_QueryContext_Call) Return

func (*Connection_QueryContext_Call) Run

func (_c *Connection_QueryContext_Call) Run(run func(ctx context.Context, query string, args ...any)) *Connection_QueryContext_Call

func (*Connection_QueryContext_Call) RunAndReturn

type Connection_Transaction_Call

type Connection_Transaction_Call struct {
	*mock.Call
}

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

func (*Connection_Transaction_Call) Return

func (*Connection_Transaction_Call) Run

func (*Connection_Transaction_Call) RunAndReturn

type Repository added in v1.2.0

type Repository struct {
	mock.Mock
}

Repository is an autogenerated mock type for the Repository type

func NewRepository added in v1.2.0

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

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) CreateMigrationHistoryTable added in v1.2.0

func (_m *Repository) CreateMigrationHistoryTable(ctx context.Context) error

CreateMigrationHistoryTable provides a mock function with given fields: ctx

func (*Repository) DropMigrationHistoryTable added in v1.2.0

func (_m *Repository) DropMigrationHistoryTable(ctx context.Context) error

DropMigrationHistoryTable provides a mock function with given fields: ctx

func (*Repository) EXPECT added in v1.2.0

func (_m *Repository) EXPECT() *Repository_Expecter

func (*Repository) ExecQuery added in v1.2.0

func (_m *Repository) ExecQuery(ctx context.Context, query string, args ...any) error

ExecQuery provides a mock function with given fields: ctx, query, args

func (*Repository) ExecQueryTransaction added in v1.2.0

func (_m *Repository) ExecQueryTransaction(ctx context.Context, fnTx func(context.Context) error) error

ExecQueryTransaction provides a mock function with given fields: ctx, fnTx

func (*Repository) ExistsMigration added in v1.2.0

func (_m *Repository) ExistsMigration(ctx context.Context, version string) (bool, error)

ExistsMigration provides a mock function with given fields: ctx, version

func (*Repository) HasMigrationHistoryTable added in v1.2.0

func (_m *Repository) HasMigrationHistoryTable(ctx context.Context) (bool, error)

HasMigrationHistoryTable provides a mock function with given fields: ctx

func (*Repository) InsertMigration added in v1.2.0

func (_m *Repository) InsertMigration(ctx context.Context, version string) error

InsertMigration provides a mock function with given fields: ctx, version

func (*Repository) Migrations added in v1.2.0

func (_m *Repository) Migrations(ctx context.Context, limit int) (entity.Migrations, error)

Migrations provides a mock function with given fields: ctx, limit

func (*Repository) MigrationsCount added in v1.2.0

func (_m *Repository) MigrationsCount(ctx context.Context) (int, error)

MigrationsCount provides a mock function with given fields: ctx

func (*Repository) QueryScalar added in v1.2.0

func (_m *Repository) QueryScalar(ctx context.Context, query string, ptr any) error

QueryScalar provides a mock function with given fields: ctx, query, ptr

func (*Repository) RemoveMigration added in v1.2.0

func (_m *Repository) RemoveMigration(ctx context.Context, version string) error

RemoveMigration provides a mock function with given fields: ctx, version

func (*Repository) TableNameWithSchema added in v1.2.0

func (_m *Repository) TableNameWithSchema() string

TableNameWithSchema provides a mock function with no fields

type Repository_CreateMigrationHistoryTable_Call added in v1.2.0

type Repository_CreateMigrationHistoryTable_Call struct {
	*mock.Call
}

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

func (*Repository_CreateMigrationHistoryTable_Call) Return added in v1.2.0

func (*Repository_CreateMigrationHistoryTable_Call) Run added in v1.2.0

func (*Repository_CreateMigrationHistoryTable_Call) RunAndReturn added in v1.2.0

type Repository_DropMigrationHistoryTable_Call added in v1.2.0

type Repository_DropMigrationHistoryTable_Call struct {
	*mock.Call
}

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

func (*Repository_DropMigrationHistoryTable_Call) Return added in v1.2.0

func (*Repository_DropMigrationHistoryTable_Call) Run added in v1.2.0

func (*Repository_DropMigrationHistoryTable_Call) RunAndReturn added in v1.2.0

type Repository_ExecQueryTransaction_Call added in v1.2.0

type Repository_ExecQueryTransaction_Call struct {
	*mock.Call
}

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

func (*Repository_ExecQueryTransaction_Call) Return added in v1.2.0

func (*Repository_ExecQueryTransaction_Call) Run added in v1.2.0

func (*Repository_ExecQueryTransaction_Call) RunAndReturn added in v1.2.0

type Repository_ExecQuery_Call added in v1.2.0

type Repository_ExecQuery_Call struct {
	*mock.Call
}

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

func (*Repository_ExecQuery_Call) Return added in v1.2.0

func (*Repository_ExecQuery_Call) Run added in v1.2.0

func (_c *Repository_ExecQuery_Call) Run(run func(ctx context.Context, query string, args ...any)) *Repository_ExecQuery_Call

func (*Repository_ExecQuery_Call) RunAndReturn added in v1.2.0

type Repository_ExistsMigration_Call added in v1.2.0

type Repository_ExistsMigration_Call struct {
	*mock.Call
}

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

func (*Repository_ExistsMigration_Call) Return added in v1.2.0

func (*Repository_ExistsMigration_Call) Run added in v1.2.0

func (*Repository_ExistsMigration_Call) RunAndReturn added in v1.2.0

type Repository_Expecter added in v1.2.0

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

func (*Repository_Expecter) CreateMigrationHistoryTable added in v1.2.0

func (_e *Repository_Expecter) CreateMigrationHistoryTable(ctx interface{}) *Repository_CreateMigrationHistoryTable_Call

CreateMigrationHistoryTable is a helper method to define mock.On call

  • ctx context.Context

func (*Repository_Expecter) DropMigrationHistoryTable added in v1.2.0

func (_e *Repository_Expecter) DropMigrationHistoryTable(ctx interface{}) *Repository_DropMigrationHistoryTable_Call

DropMigrationHistoryTable is a helper method to define mock.On call

  • ctx context.Context

func (*Repository_Expecter) ExecQuery added in v1.2.0

func (_e *Repository_Expecter) ExecQuery(ctx interface{}, query interface{}, args ...interface{}) *Repository_ExecQuery_Call

ExecQuery is a helper method to define mock.On call

  • ctx context.Context
  • query string
  • args ...any

func (*Repository_Expecter) ExecQueryTransaction added in v1.2.0

func (_e *Repository_Expecter) ExecQueryTransaction(ctx interface{}, fnTx interface{}) *Repository_ExecQueryTransaction_Call

ExecQueryTransaction is a helper method to define mock.On call

  • ctx context.Context
  • fnTx func(context.Context) error

func (*Repository_Expecter) ExistsMigration added in v1.2.0

func (_e *Repository_Expecter) ExistsMigration(ctx interface{}, version interface{}) *Repository_ExistsMigration_Call

ExistsMigration is a helper method to define mock.On call

  • ctx context.Context
  • version string

func (*Repository_Expecter) HasMigrationHistoryTable added in v1.2.0

func (_e *Repository_Expecter) HasMigrationHistoryTable(ctx interface{}) *Repository_HasMigrationHistoryTable_Call

HasMigrationHistoryTable is a helper method to define mock.On call

  • ctx context.Context

func (*Repository_Expecter) InsertMigration added in v1.2.0

func (_e *Repository_Expecter) InsertMigration(ctx interface{}, version interface{}) *Repository_InsertMigration_Call

InsertMigration is a helper method to define mock.On call

  • ctx context.Context
  • version string

func (*Repository_Expecter) Migrations added in v1.2.0

func (_e *Repository_Expecter) Migrations(ctx interface{}, limit interface{}) *Repository_Migrations_Call

Migrations is a helper method to define mock.On call

  • ctx context.Context
  • limit int

func (*Repository_Expecter) MigrationsCount added in v1.2.0

func (_e *Repository_Expecter) MigrationsCount(ctx interface{}) *Repository_MigrationsCount_Call

MigrationsCount is a helper method to define mock.On call

  • ctx context.Context

func (*Repository_Expecter) QueryScalar added in v1.2.0

func (_e *Repository_Expecter) QueryScalar(ctx interface{}, query interface{}, ptr interface{}) *Repository_QueryScalar_Call

QueryScalar is a helper method to define mock.On call

  • ctx context.Context
  • query string
  • ptr any

func (*Repository_Expecter) RemoveMigration added in v1.2.0

func (_e *Repository_Expecter) RemoveMigration(ctx interface{}, version interface{}) *Repository_RemoveMigration_Call

RemoveMigration is a helper method to define mock.On call

  • ctx context.Context
  • version string

func (*Repository_Expecter) TableNameWithSchema added in v1.2.0

func (_e *Repository_Expecter) TableNameWithSchema() *Repository_TableNameWithSchema_Call

TableNameWithSchema is a helper method to define mock.On call

type Repository_HasMigrationHistoryTable_Call added in v1.2.0

type Repository_HasMigrationHistoryTable_Call struct {
	*mock.Call
}

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

func (*Repository_HasMigrationHistoryTable_Call) Return added in v1.2.0

func (*Repository_HasMigrationHistoryTable_Call) Run added in v1.2.0

func (*Repository_HasMigrationHistoryTable_Call) RunAndReturn added in v1.2.0

type Repository_InsertMigration_Call added in v1.2.0

type Repository_InsertMigration_Call struct {
	*mock.Call
}

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

func (*Repository_InsertMigration_Call) Return added in v1.2.0

func (*Repository_InsertMigration_Call) Run added in v1.2.0

func (*Repository_InsertMigration_Call) RunAndReturn added in v1.2.0

type Repository_MigrationsCount_Call added in v1.2.0

type Repository_MigrationsCount_Call struct {
	*mock.Call
}

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

func (*Repository_MigrationsCount_Call) Return added in v1.2.0

func (*Repository_MigrationsCount_Call) Run added in v1.2.0

func (*Repository_MigrationsCount_Call) RunAndReturn added in v1.2.0

type Repository_Migrations_Call added in v1.2.0

type Repository_Migrations_Call struct {
	*mock.Call
}

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

func (*Repository_Migrations_Call) Return added in v1.2.0

func (*Repository_Migrations_Call) Run added in v1.2.0

func (*Repository_Migrations_Call) RunAndReturn added in v1.2.0

type Repository_QueryScalar_Call added in v1.2.0

type Repository_QueryScalar_Call struct {
	*mock.Call
}

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

func (*Repository_QueryScalar_Call) Return added in v1.2.0

func (*Repository_QueryScalar_Call) Run added in v1.2.0

func (*Repository_QueryScalar_Call) RunAndReturn added in v1.2.0

type Repository_RemoveMigration_Call added in v1.2.0

type Repository_RemoveMigration_Call struct {
	*mock.Call
}

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

func (*Repository_RemoveMigration_Call) Return added in v1.2.0

func (*Repository_RemoveMigration_Call) Run added in v1.2.0

func (*Repository_RemoveMigration_Call) RunAndReturn added in v1.2.0

type Repository_TableNameWithSchema_Call added in v1.2.0

type Repository_TableNameWithSchema_Call struct {
	*mock.Call
}

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

func (*Repository_TableNameWithSchema_Call) Return added in v1.2.0

func (*Repository_TableNameWithSchema_Call) Run added in v1.2.0

func (*Repository_TableNameWithSchema_Call) RunAndReturn added in v1.2.0

Jump to

Keyboard shortcuts

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