checker

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker interface {
	SetLogger(logger log.Logger)
	Check() bool
}

Checker is the interface that wraps the basic checker methods.

func NewHTTP

func NewHTTP(address string, expectStatusCode int, expectBody string, timeout time.Duration) Checker

NewHTTP creates the HTTP checker

func NewMySQL

func NewMySQL(dsn string) Checker

NewMySQL creates the MySQL checker

func NewPostgreSQL

func NewPostgreSQL(dsn string) Checker

NewPostgreSQL creates the PostgreSQL checker

func NewRedis

func NewRedis(address string, expectKey string, timeout time.Duration) Checker

NewRedis creates the Redis checker

func NewTCP

func NewTCP(address string, timeout time.Duration) Checker

NewTCP creates the TCP checker

type HTTP

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

HTTP represents HTTP checker

func (*HTTP) Check

func (h *HTTP) Check() bool

Check checks HTTP connection

func (*HTTP) SetLogger

func (h *HTTP) SetLogger(logger log.Logger)

SetLogger sets default logger

type MySQL

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

MySQL represents MySQL checker

func (*MySQL) Check

func (m *MySQL) Check() bool

Check checks MySQL connection

func (*MySQL) SetLogger

func (m *MySQL) SetLogger(logger log.Logger)

SetLogger sets default logger

type PostgreSQL

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

PostgreSQL represents PostgreSQL checker

func (*PostgreSQL) Check

func (p *PostgreSQL) Check() bool

Check checks PostgreSQL connection

func (*PostgreSQL) SetLogger

func (p *PostgreSQL) SetLogger(logger log.Logger)

SetLogger sets default logger

type Redis

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

Redis represents Redis checker

func (*Redis) Check

func (r *Redis) Check() bool

Check checks Redis connection

func (*Redis) SetLogger

func (r *Redis) SetLogger(logger log.Logger)

SetLogger sets default logger

type TCP

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

TCP represents TCP checker

func (*TCP) Check

func (t *TCP) Check() bool

Check checks TCP connection

func (*TCP) SetLogger

func (t *TCP) SetLogger(logger log.Logger)

SetLogger sets default logger

Jump to

Keyboard shortcuts

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