Documentation
¶
Overview ¶
Package pgxpoolmock is a generated GoMock package.
Index ¶
- Variables
- type MockPgxPool
- func (m *MockPgxPool) Begin(ctx context.Context) (v4.Tx, error)
- func (m *MockPgxPool) BeginFunc(ctx context.Context, f func(v4.Tx) error) error
- func (m *MockPgxPool) BeginTx(ctx context.Context, txOptions v4.TxOptions) (v4.Tx, error)
- func (m *MockPgxPool) BeginTxFunc(ctx context.Context, txOptions v4.TxOptions, f func(v4.Tx) error) error
- func (m *MockPgxPool) Close()
- func (m *MockPgxPool) EXPECT() *MockPgxPoolMockRecorder
- func (m *MockPgxPool) Exec(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error)
- func (m *MockPgxPool) Query(ctx context.Context, sql string, args ...interface{}) (v4.Rows, error)
- func (m *MockPgxPool) QueryFunc(ctx context.Context, sql string, args, scans []interface{}, ...) (pgconn.CommandTag, error)
- func (m *MockPgxPool) QueryRow(ctx context.Context, sql string, args ...interface{}) v4.Row
- func (m *MockPgxPool) SendBatch(ctx context.Context, b *v4.Batch) v4.BatchResults
- type MockPgxPoolMockRecorder
- func (mr *MockPgxPoolMockRecorder) Begin(ctx interface{}) *gomock.Call
- func (mr *MockPgxPoolMockRecorder) BeginFunc(ctx, f interface{}) *gomock.Call
- func (mr *MockPgxPoolMockRecorder) BeginTx(ctx, txOptions interface{}) *gomock.Call
- func (mr *MockPgxPoolMockRecorder) BeginTxFunc(ctx, txOptions, f interface{}) *gomock.Call
- func (mr *MockPgxPoolMockRecorder) Close() *gomock.Call
- func (mr *MockPgxPoolMockRecorder) Exec(ctx, sql interface{}, arguments ...interface{}) *gomock.Call
- func (mr *MockPgxPoolMockRecorder) Query(ctx, sql interface{}, args ...interface{}) *gomock.Call
- func (mr *MockPgxPoolMockRecorder) QueryFunc(ctx, sql, args, scans, f interface{}) *gomock.Call
- func (mr *MockPgxPoolMockRecorder) QueryRow(ctx, sql interface{}, args ...interface{}) *gomock.Call
- func (mr *MockPgxPoolMockRecorder) SendBatch(ctx, b interface{}) *gomock.Call
- type PgxPool
- type Row
- type Rows
Constants ¶
This section is empty.
Variables ¶
var CSVColumnParser = func(s string) interface{} { switch { case strings.ToLower(s) == "null": return nil } return s }
CSVColumnParser is a function which converts trimmed csv column string to a []byte representation. Currently transforms NULL to nil
Functions ¶
This section is empty.
Types ¶
type MockPgxPool ¶
type MockPgxPool struct {
// contains filtered or unexported fields
}
MockPgxPool is a mock of PgxPool interface.
func NewMockPgxPool ¶
func NewMockPgxPool(ctrl *gomock.Controller) *MockPgxPool
NewMockPgxPool creates a new mock instance.
func (*MockPgxPool) BeginTxFunc ¶
func (m *MockPgxPool) BeginTxFunc(ctx context.Context, txOptions v4.TxOptions, f func(v4.Tx) error) error
BeginTxFunc mocks base method.
func (*MockPgxPool) EXPECT ¶
func (m *MockPgxPool) EXPECT() *MockPgxPoolMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockPgxPool) Exec ¶
func (m *MockPgxPool) Exec(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error)
Exec mocks base method.
func (*MockPgxPool) QueryFunc ¶
func (m *MockPgxPool) QueryFunc(ctx context.Context, sql string, args, scans []interface{}, f func(v4.QueryFuncRow) error) (pgconn.CommandTag, error)
QueryFunc mocks base method.
func (*MockPgxPool) SendBatch ¶
func (m *MockPgxPool) SendBatch(ctx context.Context, b *v4.Batch) v4.BatchResults
SendBatch mocks base method.
type MockPgxPoolMockRecorder ¶
type MockPgxPoolMockRecorder struct {
// contains filtered or unexported fields
}
MockPgxPoolMockRecorder is the mock recorder for MockPgxPool.
func (*MockPgxPoolMockRecorder) Begin ¶
func (mr *MockPgxPoolMockRecorder) Begin(ctx interface{}) *gomock.Call
Begin indicates an expected call of Begin.
func (*MockPgxPoolMockRecorder) BeginFunc ¶
func (mr *MockPgxPoolMockRecorder) BeginFunc(ctx, f interface{}) *gomock.Call
BeginFunc indicates an expected call of BeginFunc.
func (*MockPgxPoolMockRecorder) BeginTx ¶
func (mr *MockPgxPoolMockRecorder) BeginTx(ctx, txOptions interface{}) *gomock.Call
BeginTx indicates an expected call of BeginTx.
func (*MockPgxPoolMockRecorder) BeginTxFunc ¶
func (mr *MockPgxPoolMockRecorder) BeginTxFunc(ctx, txOptions, f interface{}) *gomock.Call
BeginTxFunc indicates an expected call of BeginTxFunc.
func (*MockPgxPoolMockRecorder) Close ¶
func (mr *MockPgxPoolMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockPgxPoolMockRecorder) Exec ¶
func (mr *MockPgxPoolMockRecorder) Exec(ctx, sql interface{}, arguments ...interface{}) *gomock.Call
Exec indicates an expected call of Exec.
func (*MockPgxPoolMockRecorder) Query ¶
func (mr *MockPgxPoolMockRecorder) Query(ctx, sql interface{}, args ...interface{}) *gomock.Call
Query indicates an expected call of Query.
func (*MockPgxPoolMockRecorder) QueryFunc ¶
func (mr *MockPgxPoolMockRecorder) QueryFunc(ctx, sql, args, scans, f interface{}) *gomock.Call
QueryFunc indicates an expected call of QueryFunc.
func (*MockPgxPoolMockRecorder) QueryRow ¶
func (mr *MockPgxPoolMockRecorder) QueryRow(ctx, sql interface{}, args ...interface{}) *gomock.Call
QueryRow indicates an expected call of QueryRow.
func (*MockPgxPoolMockRecorder) SendBatch ¶
func (mr *MockPgxPoolMockRecorder) SendBatch(ctx, b interface{}) *gomock.Call
SendBatch indicates an expected call of SendBatch.
type PgxPool ¶
type PgxPool interface { Close() Exec(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error) Query(ctx context.Context, sql string, args ...interface{}) (pgx.Rows, error) QueryRow(ctx context.Context, sql string, args ...interface{}) pgx.Row QueryFunc(ctx context.Context, sql string, args []interface{}, scans []interface{}, f func(pgx.QueryFuncRow) error) (pgconn.CommandTag, error) SendBatch(ctx context.Context, b *pgx.Batch) pgx.BatchResults Begin(ctx context.Context) (pgx.Tx, error) BeginTx(ctx context.Context, txOptions pgx.TxOptions) (pgx.Tx, error) BeginFunc(ctx context.Context, f func(pgx.Tx) error) error BeginTxFunc(ctx context.Context, txOptions pgx.TxOptions, f func(pgx.Tx) error) error }
type Row ¶
type Row struct {
// contains filtered or unexported fields
}
Row is a mocked row that can be returned from QueryRow
type Rows ¶
type Rows struct {
// contains filtered or unexported fields
}
Rows is a mocked collection of rows to return for Query result
func NewRows ¶
NewMockRows allows Rows to be created from a sql interface{} slice or from the CSV string and to be used as sql driver.Rows. Use Sqlmock.NewRows instead if using a custom converter
func NewRowsWithColumnDefinition ¶
func NewRowsWithColumnDefinition(columns ...pgproto3.FieldDescription) *Rows
NewRowsWithColumnDefinition return rows with columns metadata
func (*Rows) AddRow ¶
AddRow composed from database interface{} slice return the same instance to perform subsequent actions. Note that the number of values must match the number of columns
func (*Rows) CloseError ¶
CloseError allows to set an error which will be returned by rows.Close function.
The close error will be triggered only in cases when rows.Next() EOF was not yet reached, that is a default sql library behavior
func (*Rows) FromCSVString ¶
FromCSVString build rows from csv string. return the same instance to perform subsequent actions. Note that the number of values must match the number of columns