Documentation
¶
Index ¶
- type ConnectionManager
- func (cm *ConnectionManager) Close() error
- func (cm *ConnectionManager) GetAllReadDBs() []*gorm.DB
- func (cm *ConnectionManager) GetHealthResults() <-chan HealthCheckResult
- func (cm *ConnectionManager) GetPrimaryDB() *gorm.DB
- func (cm *ConnectionManager) GetReadDB() *gorm.DB
- func (cm *ConnectionManager) GetStats() map[string]interface{}
- func (cm *ConnectionManager) IsHealthy() bool
- type HealthCheckResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectionManager ¶
type ConnectionManager struct {
// contains filtered or unexported fields
}
ConnectionManager manages database connections with pooling and health checks
func NewConnectionManager ¶
func NewConnectionManager(cfg *config.DatabaseConfig) (*ConnectionManager, error)
NewConnectionManager creates a new connection manager
func (*ConnectionManager) Close ¶
func (cm *ConnectionManager) Close() error
Close closes all database connections
func (*ConnectionManager) GetAllReadDBs ¶
func (cm *ConnectionManager) GetAllReadDBs() []*gorm.DB
GetAllReadDBs returns all read replica connections
func (*ConnectionManager) GetHealthResults ¶
func (cm *ConnectionManager) GetHealthResults() <-chan HealthCheckResult
GetHealthResults returns the health check results channel
func (*ConnectionManager) GetPrimaryDB ¶
func (cm *ConnectionManager) GetPrimaryDB() *gorm.DB
GetPrimaryDB returns the primary database connection
func (*ConnectionManager) GetReadDB ¶
func (cm *ConnectionManager) GetReadDB() *gorm.DB
GetReadDB returns a read replica database connection (round-robin)
func (*ConnectionManager) GetStats ¶
func (cm *ConnectionManager) GetStats() map[string]interface{}
GetStats returns connection statistics
func (*ConnectionManager) IsHealthy ¶
func (cm *ConnectionManager) IsHealthy() bool
IsHealthy returns true if all connections are healthy
Click to show internal directories.
Click to hide internal directories.