Documentation ¶
Index ¶
- Variables
- func AQMPProber(conn *amqp.Connection, heartbeatPeriod time.Duration) (liveness, readiness func(context.Context) healing.CheckResult)
- func CheckHelper(check func() error) healing.CheckResult
- func MySQLProbes(pool *client.Pool, maxAlive int, opts ...PoolOptions) (liveness, readiness func(context.Context) healing.CheckResult)
- func MySQLReadinessProber(pool *client.Pool, maxAlive int, opts ...PoolOptions) func(context.Context) healing.CheckResult
- func PgxProbes(pool *pgxpool.Pool, opts ...PoolOptions) (liveness, readiness func(context.Context) healing.CheckResult)
- func PgxReadinessProber(pool *pgxpool.Pool, opts ...PoolOptions) func(context.Context) healing.CheckResult
- func RedigoReadinessProber(pool *redis.Pool, opts ...PoolOptions) func(context.Context) healing.CheckResult
- func RedisReadinessProber(client *redis.Client, opts ...PoolOptions) func(context.Context) healing.CheckResult
- func SQLPoolReadinessChecker(db *sql.DB, opts ...PoolOptions) func(context.Context) healing.CheckResult
- func SQLProbes(db *sql.DB, opts ...PoolOptions) (liveness, readiness func(context.Context) healing.CheckResult)
- type PoolOptions
Constants ¶
This section is empty.
Variables ¶
var ErrPoolNotReady = errors.New("currently pool is busy")
ErrPoolNotReady indicate than database connection pool waste all available connection.
Functions ¶
func AQMPProber ¶ added in v1.14.1
func AQMPProber(conn *amqp.Connection, heartbeatPeriod time.Duration) ( liveness, readiness func(context.Context) healing.CheckResult, )
func CheckHelper ¶
func CheckHelper(check func() error) healing.CheckResult
CheckHelper is helper function for check liveness and readiness.
func MySQLProbes ¶ added in v1.13.0
func MySQLProbes(pool *client.Pool, maxAlive int, opts ...PoolOptions) ( liveness, readiness func(context.Context) healing.CheckResult, )
MySQLProbes returns liveness and readiness probes for mysql pool.
func MySQLReadinessProber ¶
func MySQLReadinessProber(pool *client.Pool, maxAlive int, opts ...PoolOptions) func(context.Context) healing.CheckResult
MySQLReadinessProber returns mysql conn pool readiness checker function.
func PgxProbes ¶ added in v1.13.0
func PgxProbes(pool *pgxpool.Pool, opts ...PoolOptions) ( liveness, readiness func(context.Context) healing.CheckResult, )
PgxProbes returns liveness and readiness probes for pgxpool.Pool.
func PgxReadinessProber ¶
func PgxReadinessProber(pool *pgxpool.Pool, opts ...PoolOptions) func(context.Context) healing.CheckResult
PgxReadinessProber returns pg conn pool readiness checker function.
func RedigoReadinessProber ¶ added in v1.17.0
func RedigoReadinessProber(pool *redis.Pool, opts ...PoolOptions) func(context.Context) healing.CheckResult
func RedisReadinessProber ¶
func RedisReadinessProber(client *redis.Client, opts ...PoolOptions) func(context.Context) healing.CheckResult
RedisReadinessProber returns redis conn pool readiness checker function.
func SQLPoolReadinessChecker ¶
func SQLPoolReadinessChecker(db *sql.DB, opts ...PoolOptions) func(context.Context) healing.CheckResult
SQLPoolReadinessChecker returns readiness checker function for golang sql.DB.
func SQLProbes ¶ added in v1.13.0
func SQLProbes(db *sql.DB, opts ...PoolOptions) ( liveness, readiness func(context.Context) healing.CheckResult, )
SQLProbes returns liveness and readiness probes for go sql.DB.
Types ¶
type PoolOptions ¶
type PoolOptions func(*pool_config)
func WithLowerLimitPool ¶
func WithLowerLimitPool(lower uint) PoolOptions
WithLowerLimitPool sets the lower limit of free connections during which a real ping of the base is performed.
func WithPoolLivenessPeriod ¶ added in v1.13.0
func WithPoolLivenessPeriod(period time.Duration) PoolOptions
WithPoolLivenessPeriod sets period between real ping requests to database.