mocks

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Querier

type Querier struct {
	QueryRowFn            func(ctx context.Context, query string, args ...any) postgres.Row
	QueryFn               func(ctx context.Context, query string, args ...any) (postgres.Rows, error)
	ExecFn                func(context.Context, uint, string, ...any) (postgres.CommandTag, error)
	ExecInTxFn            func(context.Context, func(tx postgres.Tx) error) error
	ExecInTxWithOptionsFn func(context.Context, uint, func(tx postgres.Tx) error, postgres.TxOptions) error
	CloseFn               func(context.Context) error
	// contains filtered or unexported fields
}

func (*Querier) Close

func (m *Querier) Close(ctx context.Context) error

func (*Querier) Exec

func (m *Querier) Exec(ctx context.Context, query string, args ...any) (postgres.CommandTag, error)

func (*Querier) ExecInTx added in v0.3.0

func (m *Querier) ExecInTx(ctx context.Context, fn func(tx postgres.Tx) error) error

func (*Querier) ExecInTxWithOptions added in v0.3.0

func (m *Querier) ExecInTxWithOptions(ctx context.Context, fn func(tx postgres.Tx) error, opts postgres.TxOptions) error

func (*Querier) Query

func (m *Querier) Query(ctx context.Context, query string, args ...any) (postgres.Rows, error)

func (*Querier) QueryRow

func (m *Querier) QueryRow(ctx context.Context, query string, args ...any) postgres.Row

type ReplicationConn

type ReplicationConn struct {
	IdentifySystemFn          func(ctx context.Context) (postgres.IdentifySystemResult, error)
	StartReplicationFn        func(ctx context.Context, cfg postgres.ReplicationConfig) error
	SendStandbyStatusUpdateFn func(ctx context.Context, lsn uint64) error
	ReceiveMessageFn          func(ctx context.Context) (*postgres.ReplicationMessage, error)
	CloseFn                   func(ctx context.Context) error
}

func (*ReplicationConn) Close

func (m *ReplicationConn) Close(ctx context.Context) error

func (*ReplicationConn) IdentifySystem

func (*ReplicationConn) ReceiveMessage

func (m *ReplicationConn) ReceiveMessage(ctx context.Context) (*postgres.ReplicationMessage, error)

func (*ReplicationConn) SendStandbyStatusUpdate

func (m *ReplicationConn) SendStandbyStatusUpdate(ctx context.Context, lsn uint64) error

func (*ReplicationConn) StartReplication

func (m *ReplicationConn) StartReplication(ctx context.Context, cfg postgres.ReplicationConfig) error

type Row added in v0.3.0

type Row struct {
	ScanFn func(args ...any) error
}

func (*Row) Scan added in v0.3.0

func (m *Row) Scan(args ...any) error

type Rows added in v0.3.0

type Rows struct {
	CloseFn             func()
	ErrFn               func() error
	FieldDescriptionsFn func() []pgconn.FieldDescription
	NextFn              func(i uint) bool
	ScanFn              func(dest ...any) error
	ValuesFn            func() ([]any, error)
	RawValuesFn         func() [][]byte
	// contains filtered or unexported fields
}

func (*Rows) Close added in v0.3.0

func (m *Rows) Close()

func (*Rows) CommandTag added in v0.3.0

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

func (*Rows) Conn added in v0.3.0

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

func (*Rows) Err added in v0.3.0

func (m *Rows) Err() error

func (*Rows) FieldDescriptions added in v0.3.0

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

func (*Rows) Next added in v0.3.0

func (m *Rows) Next() bool

func (*Rows) RawValues added in v0.3.0

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

func (*Rows) Scan added in v0.3.0

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

func (*Rows) Values added in v0.3.0

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

type Tx added in v0.3.0

type Tx struct {
	QueryRowFn func(ctx context.Context, query string, args ...any) postgres.Row
	QueryFn    func(ctx context.Context, query string, args ...any) (postgres.Rows, error)
	ExecFn     func(ctx context.Context, query string, args ...any) (postgres.CommandTag, error)
}

func (*Tx) Exec added in v0.3.0

func (m *Tx) Exec(ctx context.Context, query string, args ...any) (postgres.CommandTag, error)

func (*Tx) Query added in v0.3.0

func (m *Tx) Query(ctx context.Context, query string, args ...any) (postgres.Rows, error)

func (*Tx) QueryRow added in v0.3.0

func (m *Tx) QueryRow(ctx context.Context, query string, args ...any) postgres.Row

Jump to

Keyboard shortcuts

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