pgx

package
v0.0.0-...-bfcf95a Latest Latest
Warning

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

Go to latest
Published: Apr 8, 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 MockTx

type MockTx struct {
	mock.Mock
}

MockTx is an autogenerated mock type for the Tx type

func NewMockTx

func NewMockTx(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockTx

NewMockTx creates a new instance of MockTx. 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 (*MockTx) Begin

func (_m *MockTx) Begin(ctx context.Context) (pgx.Tx, error)

Begin provides a mock function with given fields: ctx

func (*MockTx) Commit

func (_m *MockTx) Commit(ctx context.Context) error

Commit provides a mock function with given fields: ctx

func (*MockTx) Conn

func (_m *MockTx) Conn() *pgx.Conn

Conn provides a mock function with given fields:

func (*MockTx) CopyFrom

func (_m *MockTx) CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource) (int64, error)

CopyFrom provides a mock function with given fields: ctx, tableName, columnNames, rowSrc

func (*MockTx) EXPECT

func (_m *MockTx) EXPECT() *MockTx_Expecter

func (*MockTx) Exec

func (_m *MockTx) Exec(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error)

Exec provides a mock function with given fields: ctx, sql, arguments

func (*MockTx) LargeObjects

func (_m *MockTx) LargeObjects() pgx.LargeObjects

LargeObjects provides a mock function with given fields:

func (*MockTx) Prepare

func (_m *MockTx) Prepare(ctx context.Context, name string, sql string) (*pgconn.StatementDescription, error)

Prepare provides a mock function with given fields: ctx, name, sql

func (*MockTx) Query

func (_m *MockTx) Query(ctx context.Context, sql string, args ...interface{}) (pgx.Rows, error)

Query provides a mock function with given fields: ctx, sql, args

func (*MockTx) QueryRow

func (_m *MockTx) QueryRow(ctx context.Context, sql string, args ...interface{}) pgx.Row

QueryRow provides a mock function with given fields: ctx, sql, args

func (*MockTx) Rollback

func (_m *MockTx) Rollback(ctx context.Context) error

Rollback provides a mock function with given fields: ctx

func (*MockTx) SendBatch

func (_m *MockTx) SendBatch(ctx context.Context, b *pgx.Batch) pgx.BatchResults

SendBatch provides a mock function with given fields: ctx, b

type MockTx_Begin_Call

type MockTx_Begin_Call struct {
	*mock.Call
}

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

func (*MockTx_Begin_Call) Return

func (_c *MockTx_Begin_Call) Return(_a0 pgx.Tx, _a1 error) *MockTx_Begin_Call

func (*MockTx_Begin_Call) Run

func (_c *MockTx_Begin_Call) Run(run func(ctx context.Context)) *MockTx_Begin_Call

func (*MockTx_Begin_Call) RunAndReturn

func (_c *MockTx_Begin_Call) RunAndReturn(run func(context.Context) (pgx.Tx, error)) *MockTx_Begin_Call

type MockTx_Commit_Call

type MockTx_Commit_Call struct {
	*mock.Call
}

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

func (*MockTx_Commit_Call) Return

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

func (*MockTx_Commit_Call) Run

func (_c *MockTx_Commit_Call) Run(run func(ctx context.Context)) *MockTx_Commit_Call

func (*MockTx_Commit_Call) RunAndReturn

func (_c *MockTx_Commit_Call) RunAndReturn(run func(context.Context) error) *MockTx_Commit_Call

type MockTx_Conn_Call

type MockTx_Conn_Call struct {
	*mock.Call
}

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

func (*MockTx_Conn_Call) Return

func (_c *MockTx_Conn_Call) Return(_a0 *pgx.Conn) *MockTx_Conn_Call

func (*MockTx_Conn_Call) Run

func (_c *MockTx_Conn_Call) Run(run func()) *MockTx_Conn_Call

func (*MockTx_Conn_Call) RunAndReturn

func (_c *MockTx_Conn_Call) RunAndReturn(run func() *pgx.Conn) *MockTx_Conn_Call

type MockTx_CopyFrom_Call

type MockTx_CopyFrom_Call struct {
	*mock.Call
}

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

func (*MockTx_CopyFrom_Call) Return

func (_c *MockTx_CopyFrom_Call) Return(_a0 int64, _a1 error) *MockTx_CopyFrom_Call

func (*MockTx_CopyFrom_Call) Run

func (_c *MockTx_CopyFrom_Call) Run(run func(ctx context.Context, tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource)) *MockTx_CopyFrom_Call

func (*MockTx_CopyFrom_Call) RunAndReturn

type MockTx_Exec_Call

type MockTx_Exec_Call struct {
	*mock.Call
}

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

func (*MockTx_Exec_Call) Return

func (_c *MockTx_Exec_Call) Return(commandTag pgconn.CommandTag, err error) *MockTx_Exec_Call

func (*MockTx_Exec_Call) Run

func (_c *MockTx_Exec_Call) Run(run func(ctx context.Context, sql string, arguments ...interface{})) *MockTx_Exec_Call

func (*MockTx_Exec_Call) RunAndReturn

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

type MockTx_Expecter

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

func (*MockTx_Expecter) Begin

func (_e *MockTx_Expecter) Begin(ctx interface{}) *MockTx_Begin_Call

Begin is a helper method to define mock.On call

  • ctx context.Context

func (*MockTx_Expecter) Commit

func (_e *MockTx_Expecter) Commit(ctx interface{}) *MockTx_Commit_Call

Commit is a helper method to define mock.On call

  • ctx context.Context

func (*MockTx_Expecter) Conn

func (_e *MockTx_Expecter) Conn() *MockTx_Conn_Call

Conn is a helper method to define mock.On call

func (*MockTx_Expecter) CopyFrom

func (_e *MockTx_Expecter) CopyFrom(ctx interface{}, tableName interface{}, columnNames interface{}, rowSrc interface{}) *MockTx_CopyFrom_Call

CopyFrom is a helper method to define mock.On call

  • ctx context.Context
  • tableName pgx.Identifier
  • columnNames []string
  • rowSrc pgx.CopyFromSource

func (*MockTx_Expecter) Exec

func (_e *MockTx_Expecter) Exec(ctx interface{}, sql interface{}, arguments ...interface{}) *MockTx_Exec_Call

Exec is a helper method to define mock.On call

  • ctx context.Context
  • sql string
  • arguments ...interface{}

func (*MockTx_Expecter) LargeObjects

func (_e *MockTx_Expecter) LargeObjects() *MockTx_LargeObjects_Call

LargeObjects is a helper method to define mock.On call

func (*MockTx_Expecter) Prepare

func (_e *MockTx_Expecter) Prepare(ctx interface{}, name interface{}, sql interface{}) *MockTx_Prepare_Call

Prepare is a helper method to define mock.On call

  • ctx context.Context
  • name string
  • sql string

func (*MockTx_Expecter) Query

func (_e *MockTx_Expecter) Query(ctx interface{}, sql interface{}, args ...interface{}) *MockTx_Query_Call

Query is a helper method to define mock.On call

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

func (*MockTx_Expecter) QueryRow

func (_e *MockTx_Expecter) QueryRow(ctx interface{}, sql interface{}, args ...interface{}) *MockTx_QueryRow_Call

QueryRow is a helper method to define mock.On call

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

func (*MockTx_Expecter) Rollback

func (_e *MockTx_Expecter) Rollback(ctx interface{}) *MockTx_Rollback_Call

Rollback is a helper method to define mock.On call

  • ctx context.Context

func (*MockTx_Expecter) SendBatch

func (_e *MockTx_Expecter) SendBatch(ctx interface{}, b interface{}) *MockTx_SendBatch_Call

SendBatch is a helper method to define mock.On call

  • ctx context.Context
  • b *pgx.Batch

type MockTx_LargeObjects_Call

type MockTx_LargeObjects_Call struct {
	*mock.Call
}

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

func (*MockTx_LargeObjects_Call) Return

func (*MockTx_LargeObjects_Call) Run

func (*MockTx_LargeObjects_Call) RunAndReturn

func (_c *MockTx_LargeObjects_Call) RunAndReturn(run func() pgx.LargeObjects) *MockTx_LargeObjects_Call

type MockTx_Prepare_Call

type MockTx_Prepare_Call struct {
	*mock.Call
}

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

func (*MockTx_Prepare_Call) Return

func (*MockTx_Prepare_Call) Run

func (_c *MockTx_Prepare_Call) Run(run func(ctx context.Context, name string, sql string)) *MockTx_Prepare_Call

func (*MockTx_Prepare_Call) RunAndReturn

type MockTx_QueryRow_Call

type MockTx_QueryRow_Call struct {
	*mock.Call
}

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

func (*MockTx_QueryRow_Call) Return

func (*MockTx_QueryRow_Call) Run

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

func (*MockTx_QueryRow_Call) RunAndReturn

func (_c *MockTx_QueryRow_Call) RunAndReturn(run func(context.Context, string, ...interface{}) pgx.Row) *MockTx_QueryRow_Call

type MockTx_Query_Call

type MockTx_Query_Call struct {
	*mock.Call
}

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

func (*MockTx_Query_Call) Return

func (_c *MockTx_Query_Call) Return(_a0 pgx.Rows, _a1 error) *MockTx_Query_Call

func (*MockTx_Query_Call) Run

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

func (*MockTx_Query_Call) RunAndReturn

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

type MockTx_Rollback_Call

type MockTx_Rollback_Call struct {
	*mock.Call
}

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

func (*MockTx_Rollback_Call) Return

func (*MockTx_Rollback_Call) Run

func (_c *MockTx_Rollback_Call) Run(run func(ctx context.Context)) *MockTx_Rollback_Call

func (*MockTx_Rollback_Call) RunAndReturn

func (_c *MockTx_Rollback_Call) RunAndReturn(run func(context.Context) error) *MockTx_Rollback_Call

type MockTx_SendBatch_Call

type MockTx_SendBatch_Call struct {
	*mock.Call
}

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

func (*MockTx_SendBatch_Call) Return

func (*MockTx_SendBatch_Call) Run

func (*MockTx_SendBatch_Call) RunAndReturn

Jump to

Keyboard shortcuts

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