Documentation ¶
Overview ¶
Helpers for working with PostgreSQL databases
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListenOnChannel ¶
func ListenOnChannel(ctx context.Context, db string, channelName string, errorCallback func(error)) (<-chan *pq.Notification, error)
Connect to the the given PostgreSQL database (dbName, which must be a PostgreSQL connection string) and listen on the given channel (channelName) until the context is canceled. The database connection is kept alive with regular pings. If the connection is broken, it is automatically reestablished, and if errorCallback is non-nil, it will be invoked with details about the problem which caused the disconnection.
Returns a channel from which to read the notifications.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.