Documentation
¶
Overview ¶
This package opens and retains a pool of distinct DBMS connections.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DbmsEntry ¶ added in v0.2.0
type DbmsEntry struct {
Entry
// contains filtered or unexported fields
}
DbmsEntry represents a standard Dbms connection.
type DbmsPool ¶ added in v0.2.0
type DbmsPool struct {
// contains filtered or unexported fields
}
DbmsPool is a map of pool entries identified by a unique name.
func NewDbmsPool ¶ added in v0.2.0
func NewDbmsPool(rps int) DbmsPool
NewDbmsPool initializes a DbmsPool struct with the given rps. See also database.RateLimitedDbmsConn.
func (DbmsPool) Get ¶ added in v0.2.0
func (pool DbmsPool) Get(name string) Entry
Get retrieves an Entry from pool.
func (DbmsPool) Keepalive ¶ added in v1.0.0
func (pool DbmsPool) Keepalive(interval time.Duration, logger logr.Logger)
Keepalive starts a periodic ping to each endpoint, if an endpoint becomes unreachable, an error is logged.
func (DbmsPool) Register ¶ added in v0.2.0
func (pool DbmsPool) Register(name string, driver string, dsn database.Dsn) error
Register registers a new database.Dbms in the pool.
func (DbmsPool) RegisterDbms ¶ added in v0.2.0
func (pool DbmsPool) RegisterDbms(dbms database.Dbms, driver string) error
RegisterDbms is a utility function around Register. It iterates over database.Dbms.Endpoints and registers a connection for each endpoint.
Click to show internal directories.
Click to hide internal directories.