healthcheck

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

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 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 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