Documentation ¶
Overview ¶
Package timeout provides a wrapper for pool.Pool that confirms every passed in context.Context has a timeout.
Index ¶
- type ContextTimeout
- func (c ContextTimeout) Acquire(ctx context.Context) (*pgxpool.Conn, error)
- func (c ContextTimeout) AcquireAllIdle(ctx context.Context) []*pgxpool.Conn
- func (c ContextTimeout) AcquireFunc(ctx context.Context, f func(*pgxpool.Conn) error) error
- func (c ContextTimeout) Begin(ctx context.Context) (pgx.Tx, error)
- func (c ContextTimeout) BeginFunc(ctx context.Context, f func(pgx.Tx) error) error
- func (c ContextTimeout) BeginTx(ctx context.Context, txOptions pgx.TxOptions) (pgx.Tx, error)
- func (c ContextTimeout) BeginTxFunc(ctx context.Context, txOptions pgx.TxOptions, f func(pgx.Tx) error) error
- func (c ContextTimeout) Close()
- func (c ContextTimeout) Config() *pgxpool.Config
- func (c ContextTimeout) CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, ...) (int64, error)
- func (c ContextTimeout) Exec(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error)
- func (c ContextTimeout) Ping(ctx context.Context) error
- func (c ContextTimeout) Query(ctx context.Context, sql string, args ...interface{}) (pgx.Rows, error)
- func (c ContextTimeout) QueryFunc(ctx context.Context, sql string, args []interface{}, scans []interface{}, ...) (pgconn.CommandTag, error)
- func (c ContextTimeout) QueryRow(ctx context.Context, sql string, args ...interface{}) pgx.Row
- func (c ContextTimeout) SendBatch(ctx context.Context, b *pgx.Batch) pgx.BatchResults
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) AcquireAllIdle ¶
func (c ContextTimeout) AcquireAllIdle(ctx context.Context) []*pgxpool.Conn
AcquireAllIdle implements pool.Pool.
func (ContextTimeout) AcquireFunc ¶
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) 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.