healthcheck

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// LivenessCheck represents liveness check.
	LivenessCheck = "liveness"
	// ReadinessCheck represents readiness check.
	ReadinessCheck = "readiness"
)
View Source
const ExternalConfigName = "healthcheck"

ExternalConfigName is the external config name of health check.

Variables

This section is empty.

Functions

func Checker

func Checker(checker HealthChecker) nirvana.Configurer

Checker returns a configurer to set health checker.

func CheckerWithType added in v0.2.2

func CheckerWithType(checker HealthCheckerWithType) nirvana.Configurer

CheckerWithType returns a configurer to set health checker with a type parameter.

func Disable

func Disable() nirvana.Configurer

Disable returns a configurer to disable healthcheck.

func Path

func Path(path string) nirvana.Configurer

Path returns a configurer to set health check path.

Types

type HealthChecker

type HealthChecker func(ctx context.Context) error

HealthChecker checks if current server is healthy.

type HealthCheckerWithType added in v0.2.2

type HealthCheckerWithType func(ctx context.Context, checkType string) error

HealthCheckerWithType checks if current server is healthy. The `checkType` parameter indicates the type of health check, such as liveness or readiness.

type Option

type Option struct {
	Path string `desc:"Health check path"`
	// contains filtered or unexported fields
}

Option contains basic configurations of healthcheck.

func NewOption

func NewOption(checker HealthChecker) *Option

NewOption creates default option.

func (*Option) Configure

func (p *Option) Configure(cfg *nirvana.Config) error

Configure configures nirvana config via current options.

func (*Option) Name

func (p *Option) Name() string

Name returns plugin name.

Jump to

Keyboard shortcuts

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