Documentation ¶
Index ¶
- func ListenToNotifications(ctx context.Context, pool PgxPool, channel string, ...)
- type MockConn
- type MockPool
- func (m *MockPool) Acquire(ctx context.Context) (PgxConn, error)
- func (m *MockPool) Close()
- func (m *MockPool) Exec(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error)
- func (m *MockPool) Query(ctx context.Context, sql string, arguments ...interface{}) (pgx.Rows, error)
- func (m *MockPool) QueryRow(ctx context.Context, sql string, arguments ...interface{}) pgx.Row
- type MockRow
- type MockRows
- type PgxConn
- type PgxPool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListenToNotifications ¶
func ListenToNotifications(ctx context.Context, pool PgxPool, channel string, handleFunc func(notification *pgconn.Notification))
ListenToNotifications listens for notifications on a PostgreSQL channel and triggers a handler function when a notification is received.
Types ¶
type MockConn ¶
MockConn is a mock implementation of the Conn interface.
func (*MockConn) WaitForNotification ¶
type MockPool ¶
MockPool is a mock implementation of the Pool interface.
type PgxConn ¶
type PgxConn interface { Exec(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error) WaitForNotification(ctx context.Context) (*pgconn.Notification, error) Release() }
PgxConn defines the interface for a connection.
type PgxPool ¶
type PgxPool interface { Acquire(ctx context.Context) (PgxConn, error) Close() Exec(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error) Query(ctx context.Context, sql string, arguments ...interface{}) (pgx.Rows, error) QueryRow(ctx context.Context, sql string, arguments ...interface{}) pgx.Row }
PgxPool defines the interface for a connection pool.
func NewPGXPoolWrapper ¶
NewPGXPoolWrapper creates a new PGXPoolWrapper with the given pool.
Click to show internal directories.
Click to hide internal directories.