checks

package
v0.0.0-...-978d9fb Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const HTTP_TYPE = "http"
View Source
const REDIS_TYPE = "redis"
View Source
const SQL_TYPE = "sql"

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckFunc

type CheckFunc func() Result

type created to make the func implement check interface

func (CheckFunc) Check

func (cf CheckFunc) Check() Result

type Checker

type Checker interface {
	Check() Result
}

Checker is a interface used to provide an indication of application health.

func NewFileChecker

func NewFileChecker(filename string) Checker

type HttpChecker

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

func NewHttpChecker

func NewHttpChecker(name, endpoint string, timeout time.Duration) *HttpChecker

func (HttpChecker) Check

func (receiver HttpChecker) Check() Result

type RedisChecker

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

func NewRedisChecker

func NewRedisChecker(name, address, password string, timeout time.Duration, isTls bool) *RedisChecker

func (*RedisChecker) Check

func (receiver *RedisChecker) Check() Result

type Result

type Result struct {
	Name     string  `json:"-"`
	Typez    string  `json:"type"`
	Success  bool    `json:"success"`
	Duration float64 `json:"duration"`
	Err      error   `json:"error,omitempty"`
	Reason   interface{}
}

type SqlChecker

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

func NewSqlChecker

func NewSqlChecker(name, driverName, dataSourceName string) *SqlChecker

func (SqlChecker) Check

func (receiver SqlChecker) Check() Result

Jump to

Keyboard shortcuts

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