checker

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDBChecker

func NewDBChecker(name, checkSQL, versionSQL string, db *sql.DB) health.Checker

NewRedisChecker returns a new db.DBChecker with the given URL

func NewDefaultRedisChecker

func NewDefaultRedisChecker(client *redis.Client) health.Checker

NewDefaultRedisChecker returns a new redis.Checker configured with a custom Redis implementation

func NewMySQLChecker

func NewMySQLChecker(db *sql.DB) health.Checker

NewMySQLChecker returns a new db.DBChecker configured for use in MySQL

func NewPostgreSQLChecker

func NewPostgreSQLChecker(db *sql.DB) health.Checker

NewPostgreSQLChecker returns a new db.DBChecker configured for use in PostgreSQL

func NewRabbitChecker

func NewRabbitChecker(conn *amqp.Connection) health.Checker

func NewRedisChecker

func NewRedisChecker(name string, client *redis.Client) health.Checker

NewRedisChecker returns a new redis.Checker

Types

type DBChecker

type DBChecker struct {
	// contains filtered or unexported fields
}

DBChecker is a checker that check a database connection

func (DBChecker) Check

func (c DBChecker) Check() health.Health

Check execute two queries in the database The first is a simple one used to verify if the database is up If is Up then another query is executed, querying for the database version

func (DBChecker) Name

func (c DBChecker) Name() string

type RabbitChecker

type RabbitChecker struct {
	// contains filtered or unexported fields
}

func (RabbitChecker) Check

func (c RabbitChecker) Check() health.Health

func (RabbitChecker) Name

func (c RabbitChecker) Name() string

type Redis

type Redis interface {
	GetVersion() (string, error)
}

Redis is a interface used to abstract the access of the Version string

type RedisChecker

type RedisChecker struct {
	// contains filtered or unexported fields
}

Checker is a checker that check a given redis

func (RedisChecker) Check

func (c RedisChecker) Check() health.Health

Check obtain the version string from redis info command

func (RedisChecker) Name

func (c RedisChecker) Name() string

Jump to

Keyboard shortcuts

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