healthcheck

package
v0.0.0-...-7fa21a5 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2023 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypePing = "ping"
	TypeHTTP = "http"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthCheck

type HealthCheck struct {
	Name     string        `record:"name,optional"`
	Type     string        `record:"type,optional"`
	Timeout  time.Duration `record:"timeout"`
	Failures int           `record:"failures"`
	// contains filtered or unexported fields
}

func (*HealthCheck) Copy

func (hc *HealthCheck) Copy() *HealthCheck

Copies the health check without duplicating the target.

func (*HealthCheck) SetRequestTransformer

func (hc *HealthCheck) SetRequestTransformer(transformer func(interface{}) interface{})

func (*HealthCheck) SetTarget

func (hc *HealthCheck) SetTarget(target string)

func (*HealthCheck) Target

func (hc *HealthCheck) Target() string

type HealthCheckAction

type HealthCheckAction struct {
	Check        *HealthCheck
	FailedAction func(*HealthCheck) error
	ReviveAction func(*HealthCheck) error
}

type HealthChecker

type HealthChecker struct {
	HealthChecks []*HealthCheckAction
	Failures     []int
	// contains filtered or unexported fields
}

func Init

func Init(checks []*HealthCheckAction, minDuration time.Duration) *HealthChecker

func (*HealthChecker) Shutdown

func (hcr *HealthChecker) Shutdown()

func (*HealthChecker) Start

func (hcr *HealthChecker) Start()

Jump to

Keyboard shortcuts

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