mocks

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Anything anythingMatcher

Anything matches any argument in EXPECT() calls.

Functions

This section is empty.

Types

type Executor

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

func NewExecutor

func NewExecutor(t testingT) *Executor

func (*Executor) EXPECT

func (m *Executor) EXPECT() *ExecutorExpecter

func (*Executor) Exec

func (m *Executor) Exec(ctx context.Context, sql string, arguments ...any) (pgconn.CommandTag, error)

func (*Executor) Query

func (m *Executor) Query(ctx context.Context, sql string, arguments ...any) (pgx.Rows, error)

func (*Executor) QueryRow

func (m *Executor) QueryRow(ctx context.Context, sql string, arguments ...any) pgx.Row

type ExecutorExecCall

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

func (*ExecutorExecCall) Once

func (*ExecutorExecCall) Return

func (*ExecutorExecCall) Run

func (c *ExecutorExecCall) Run(run func(context.Context, string, ...any)) *ExecutorExecCall

func (*ExecutorExecCall) RunAndReturn

func (c *ExecutorExecCall) RunAndReturn(fn func(context.Context, string, ...any) (pgconn.CommandTag, error)) *ExecutorExecCall

type ExecutorExpecter

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

func (*ExecutorExpecter) Exec

func (e *ExecutorExpecter) Exec(ctx, sql any, arguments ...any) *ExecutorExecCall

func (*ExecutorExpecter) Query

func (e *ExecutorExpecter) Query(ctx, sql any, arguments ...any) *ExecutorQueryCall

func (*ExecutorExpecter) QueryRow

func (e *ExecutorExpecter) QueryRow(ctx, sql any, arguments ...any) *ExecutorQueryRowCall

type ExecutorProvider

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

func NewExecutorProvider

func NewExecutorProvider(t testingT) *ExecutorProvider

func (*ExecutorProvider) EXPECT

func (*ExecutorProvider) GetExecutor

func (m *ExecutorProvider) GetExecutor(ctx context.Context) pgxtx.Executor

type ExecutorProviderExpecter

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

func (*ExecutorProviderExpecter) GetExecutor

type ExecutorProviderGetExecutorCall

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

func (*ExecutorProviderGetExecutorCall) Once

func (*ExecutorProviderGetExecutorCall) Return

func (*ExecutorProviderGetExecutorCall) Run

func (*ExecutorProviderGetExecutorCall) RunAndReturn

type ExecutorQueryCall

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

func (*ExecutorQueryCall) Once

func (*ExecutorQueryCall) Return

func (c *ExecutorQueryCall) Return(rows pgx.Rows, err error) *ExecutorQueryCall

func (*ExecutorQueryCall) Run

func (c *ExecutorQueryCall) Run(run func(context.Context, string, ...any)) *ExecutorQueryCall

func (*ExecutorQueryCall) RunAndReturn

func (c *ExecutorQueryCall) RunAndReturn(fn func(context.Context, string, ...any) (pgx.Rows, error)) *ExecutorQueryCall

type ExecutorQueryRowCall

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

func (*ExecutorQueryRowCall) Once

func (*ExecutorQueryRowCall) Return

func (*ExecutorQueryRowCall) Run

func (*ExecutorQueryRowCall) RunAndReturn

func (c *ExecutorQueryRowCall) RunAndReturn(fn func(context.Context, string, ...any) pgx.Row) *ExecutorQueryRowCall

type Manager

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

func NewManager

func NewManager(t testingT) *Manager

func (*Manager) EXPECT

func (m *Manager) EXPECT() *ManagerExpecter

func (*Manager) ExecInTx

func (m *Manager) ExecInTx(ctx context.Context, fn func(context.Context, pgxtx.Executor) error) error

func (*Manager) GetExecutor

func (m *Manager) GetExecutor(ctx context.Context) pgxtx.Executor

func (*Manager) WithTx

func (m *Manager) WithTx(ctx context.Context, fn pgxtx.TxFunc) error

type ManagerExecInTxCall

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

func (*ManagerExecInTxCall) Once

func (*ManagerExecInTxCall) Return

func (*ManagerExecInTxCall) Run

func (*ManagerExecInTxCall) RunAndReturn

type ManagerExpecter

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

func (*ManagerExpecter) ExecInTx

func (e *ManagerExpecter) ExecInTx(ctx, fn any) *ManagerExecInTxCall

func (*ManagerExpecter) GetExecutor

func (e *ManagerExpecter) GetExecutor(ctx any) *ManagerGetExecutorCall

func (*ManagerExpecter) WithTx

func (e *ManagerExpecter) WithTx(ctx, fn any) *ManagerWithTxCall

type ManagerGetExecutorCall

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

func (*ManagerGetExecutorCall) Once

func (*ManagerGetExecutorCall) Return

func (*ManagerGetExecutorCall) Run

func (*ManagerGetExecutorCall) RunAndReturn

type ManagerWithTxCall

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

func (*ManagerWithTxCall) Once

func (*ManagerWithTxCall) Return

func (c *ManagerWithTxCall) Return(err error) *ManagerWithTxCall

func (*ManagerWithTxCall) Run

func (*ManagerWithTxCall) RunAndReturn

func (c *ManagerWithTxCall) RunAndReturn(fn func(context.Context, pgxtx.TxFunc) error) *ManagerWithTxCall

type Rows added in v0.3.0

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

func NewRows added in v0.3.0

func NewRows(t testingT) *Rows

func (*Rows) AddRow added in v0.3.0

func (r *Rows) AddRow(values ...any) *Rows

func (*Rows) Close added in v0.3.0

func (r *Rows) Close()

func (*Rows) CommandTag added in v0.3.0

func (r *Rows) CommandTag() pgconn.CommandTag

func (*Rows) Conn added in v0.3.0

func (r *Rows) Conn() *pgx.Conn

func (*Rows) Err added in v0.3.0

func (r *Rows) Err() error

func (*Rows) FieldDescriptions added in v0.3.0

func (r *Rows) FieldDescriptions() []pgconn.FieldDescription

func (*Rows) Next added in v0.3.0

func (r *Rows) Next() bool

func (*Rows) RawValues added in v0.3.0

func (r *Rows) RawValues() [][]byte

func (*Rows) Scan added in v0.3.0

func (r *Rows) Scan(dest ...any) error

func (*Rows) Values added in v0.3.0

func (r *Rows) Values() ([]any, error)

func (*Rows) WithCommandTag added in v0.3.0

func (r *Rows) WithCommandTag(tag pgconn.CommandTag) *Rows

func (*Rows) WithError added in v0.3.0

func (r *Rows) WithError(err error) *Rows

func (*Rows) WithFieldDescriptions added in v0.3.0

func (r *Rows) WithFieldDescriptions(fields []pgconn.FieldDescription) *Rows

type TxRunner

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

func NewTxRunner

func NewTxRunner(t testingT) *TxRunner

func (*TxRunner) EXPECT

func (m *TxRunner) EXPECT() *TxRunnerExpecter

func (*TxRunner) ExecInTx

func (m *TxRunner) ExecInTx(ctx context.Context, fn func(context.Context, pgxtx.Executor) error) error

func (*TxRunner) WithTx

func (m *TxRunner) WithTx(ctx context.Context, fn pgxtx.TxFunc) error

type TxRunnerExecInTxCall

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

func (*TxRunnerExecInTxCall) Once

func (*TxRunnerExecInTxCall) Return

func (*TxRunnerExecInTxCall) Run

func (*TxRunnerExecInTxCall) RunAndReturn

type TxRunnerExpecter

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

func (*TxRunnerExpecter) ExecInTx

func (e *TxRunnerExpecter) ExecInTx(ctx, fn any) *TxRunnerExecInTxCall

func (*TxRunnerExpecter) WithTx

func (e *TxRunnerExpecter) WithTx(ctx, fn any) *TxRunnerWithTxCall

type TxRunnerWithTxCall

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

func (*TxRunnerWithTxCall) Once

func (*TxRunnerWithTxCall) Return

func (*TxRunnerWithTxCall) Run

func (*TxRunnerWithTxCall) RunAndReturn

Jump to

Keyboard shortcuts

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