checkers

package
v1.17.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2023 License: Apache-2.0, MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL