healthcheck

package
v0.3.5-0...-95db35b Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package healthcheck provide ability to check third-party services are alive of offline. currently it's simple and base

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthChecker

type HealthChecker interface {
	Check() HealthInfo
}

HealthChecker .

func NewMgoChecker

func NewMgoChecker(db *mgov2.Database) HealthChecker

NewMgoChecker .

func NewRedisChecker

func NewRedisChecker(client *redis.Client) HealthChecker

NewRedisChecker .

func NewSQLChecker

func NewSQLChecker(db *sql.DB) HealthChecker

NewSQLChecker .

func NewTCPChecker

func NewTCPChecker(addr string) HealthChecker

NewTCPChecker .

type HealthCheckingMgr

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

HealthCheckingMgr .

func NewHealthMgr

func NewHealthMgr() *HealthCheckingMgr

NewHealthMgr .

func (*HealthCheckingMgr) AddChecker

func (mgr *HealthCheckingMgr) AddChecker(name string, hchecker HealthChecker, timeout int)

AddChecker of mgr

func (*HealthCheckingMgr) GinHandler

func (mgr *HealthCheckingMgr) GinHandler() gin.HandlerFunc

GinHandler .

func (*HealthCheckingMgr) Handler

func (mgr *HealthCheckingMgr) Handler() http.HandlerFunc

Handler .

type HealthInfo

type HealthInfo struct {
	Healthy bool                   `json:"healthy"`
	Meta    map[string]interface{} `json:"meta,omitempty"`
	// contains filtered or unexported fields
}

HealthInfo to describe the status of target

func NewHealthInfo

func NewHealthInfo() HealthInfo

NewHealthInfo .

Jump to

Keyboard shortcuts

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