Documentation
¶
Index ¶
- func ID(host, username string) string
- type Config
- type ConnectionPoolInterface
- type Pool
- func (pp *Pool) Close()
- func (pp *Pool) GetConnectionPool() ConnectionPoolInterface
- func (pp *Pool) GetDrainDuration() time.Duration
- func (pp *Pool) GetMigrationID() string
- func (pp *Pool) GetProvider() Config
- func (pp *Pool) GetState() State
- func (pp *Pool) GetStats() PoolStats
- func (pp *Pool) IsAcceptingConnections() bool
- func (pp *Pool) SetMigrationID(id string)
- func (pp *Pool) SetState(state State)
- type PoolStats
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config interface {
ID() string
GetHost() string
GetUsername() string
GetPassword() string
GetPort() int
GetMaxConnections() int
GetMaxConnectionIdleTimeInSeconds() int
GetMaxConnectionTTLInSeconds() int
GetTLS() bool
GetInsecureSSL() bool
GetIsBackupProvider() bool
}
Config represents the configuration for a single provider
type ConnectionPoolInterface ¶
type ConnectionPoolInterface interface {
Acquire(ctx interface{}) (interface{}, error)
AcquireAllIdle() []interface{}
Close()
Stat() PoolStats
}
ConnectionPoolInterface represents the underlying connection pool
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool manages a connection pool for a single provider
func NewPool ¶
func NewPool(connectionPool ConnectionPoolInterface, provider Config) *Pool
NewPool creates a new provider pool
func (*Pool) GetConnectionPool ¶
func (pp *Pool) GetConnectionPool() ConnectionPoolInterface
GetConnectionPool returns the underlying connection pool
func (*Pool) GetDrainDuration ¶
GetDrainDuration returns how long the provider has been draining
func (*Pool) GetMigrationID ¶
GetMigrationID returns the current migration ID
func (*Pool) GetProvider ¶
GetProvider returns the provider configuration
func (*Pool) IsAcceptingConnections ¶
IsAcceptingConnections returns whether the pool is accepting new connections
func (*Pool) SetMigrationID ¶
SetMigrationID sets the migration ID for tracking purposes
Click to show internal directories.
Click to hide internal directories.