Documentation ¶
Index ¶
- type ConnCollection
- func (c *ConnCollection) Close()
- func (c *ConnCollection) Init(keepAlive, queryTimeout int, logr log.Logger)
- func (c *ConnCollection) PingHandler(metricParams map[string]string, _ ...string) (any, error)
- func (c *ConnCollection) WithConnHandlerFunc(handler handlers.ConnHandlerFunc) handlers.HandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnCollection ¶
type ConnCollection struct {
// contains filtered or unexported fields
}
ConnCollection is a collection of connections to the database. Allows managing multiple connections.
func (*ConnCollection) Close ¶
func (c *ConnCollection) Close()
Close closes all connections in the collection.
func (*ConnCollection) Init ¶
func (c *ConnCollection) Init(keepAlive, queryTimeout int, logr log.Logger)
Init initializes a pre-allocated connection collection.
func (*ConnCollection) PingHandler ¶
PingHandler tries to ping the database, returning 1 on success 0 on failure.
func (*ConnCollection) WithConnHandlerFunc ¶
func (c *ConnCollection) WithConnHandlerFunc( handler handlers.ConnHandlerFunc, ) handlers.HandlerFunc
WithConnHandlerFunc creates a new function that creates or gets cached DB connection for the given metric parameters and calls the given handler function with the connection.
Click to show internal directories.
Click to hide internal directories.