timeout

package
v0.0.0-...-7544f7c Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package timeout provides a wrapper for pool.Pool that confirms every passed in context.Context has a timeout.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextTimeout

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

ContextTimeout implements pool.Pool and confirms that every passed in context.Context has a timeout.

func New

func New(db pool.Pool) ContextTimeout

New returns a ContextTimeout that wraps the given pool.Pool.

func (ContextTimeout) Acquire

func (c ContextTimeout) Acquire(ctx context.Context) (*pgxpool.Conn, error)

Acquire implements pool.Pool.

func (ContextTimeout) AcquireAllIdle

func (c ContextTimeout) AcquireAllIdle(ctx context.Context) []*pgxpool.Conn

AcquireAllIdle implements pool.Pool.

func (ContextTimeout) AcquireFunc

func (c ContextTimeout) AcquireFunc(ctx context.Context, f func(*pgxpool.Conn) error) error

AcquireFunc implements pool.Pool.

func (ContextTimeout) Begin

func (c ContextTimeout) Begin(ctx context.Context) (pgx.Tx, error)

Begin implements pool.Pool.

func (ContextTimeout) BeginFunc

func (c ContextTimeout) BeginFunc(ctx context.Context, f func(pgx.Tx) error) error

BeginFunc implements pool.Pool.

func (ContextTimeout) BeginTx

func (c ContextTimeout) BeginTx(ctx context.Context, txOptions pgx.TxOptions) (pgx.Tx, error)

BeginTx implements pool.Pool.

func (ContextTimeout) BeginTxFunc

func (c ContextTimeout) BeginTxFunc(ctx context.Context, txOptions pgx.TxOptions, f func(pgx.Tx) error) error

BeginTxFunc implements pool.Pool.

func (ContextTimeout) Close

func (c ContextTimeout) Close()

Close implements pool.Pool.

func (ContextTimeout) Config

func (c ContextTimeout) Config() *pgxpool.Config

Config implements pool.Pool.

func (ContextTimeout) CopyFrom

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

CopyFrom implements pool.Pool.

func (ContextTimeout) Exec

func (c ContextTimeout) Exec(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error)

Exec implements pool.Pool.

func (ContextTimeout) Ping

func (c ContextTimeout) Ping(ctx context.Context) error

Ping implements pool.Pool.

func (ContextTimeout) Query

func (c ContextTimeout) Query(ctx context.Context, sql string, args ...interface{}) (pgx.Rows, error)

Query implements pool.Pool.

func (ContextTimeout) QueryFunc

func (c ContextTimeout) QueryFunc(ctx context.Context, sql string, args []interface{}, scans []interface{}, f func(pgx.QueryFuncRow) error) (pgconn.CommandTag, error)

QueryFunc implements pool.Pool.

func (ContextTimeout) QueryRow

func (c ContextTimeout) QueryRow(ctx context.Context, sql string, args ...interface{}) pgx.Row

QueryRow implements pool.Pool.

func (ContextTimeout) SendBatch

func (c ContextTimeout) SendBatch(ctx context.Context, b *pgx.Batch) pgx.BatchResults

SendBatch implements pool.Pool.

Jump to

Keyboard shortcuts

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