xhealth

package
v0.0.0-...-73d6a9a Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Module

func Module() fx.Option

func ProvideRouteMapping

func ProvideRouteMapping(c HealthHandler, cfg Config) xhttp.RouteMapping

ProvideRouteMapping provide and Server HTTP Route to be registered by the server module.

func RegisterHealthChecks

func RegisterHealthChecks(h HealthHandler, checks ChecksMappings, logger xlog.OptionalLogger)

RegisterHealthChecks register the checks populated in ChecksMappings.

Types

type CheckMapping

type CheckMapping struct {
	fx.Out

	Checker *Checker `group:"x_health"`
}

CheckMapping wrap the return of a health check.

func NewCheckMapping

func NewCheckMapping(name string, checker health.Checker) CheckMapping

type Checker

type Checker struct {
	Name    string
	Checker health.Checker
}

Checker holds the name and a Checker function to be executed.

type ChecksMappings

type ChecksMappings struct {
	fx.In

	Checks []*Checker `group:"x_health"`
}

ChecksMappings hold all checks registered by the container.

type Config

type Config struct {
	Path string
}

Config holds health check configuration.

func LoadConfig

func LoadConfig(params LoadConfigParams) (Config, error)

type HealthHandler

type HealthHandler struct {
	fx.In

	Handler *health.Handler `name:"x_healthcheck"`
}

HealthHandler ir necessary to access the healthcheck by name

type HealthHandlerQualifier

type HealthHandlerQualifier struct {
	fx.Out

	Handler *health.Handler `name:"x_healthcheck"`
}

HealthHandlerQualifier is necessary to give a name to the health check

func NewHealth

func NewHealth() HealthHandlerQualifier

NewHealth create a new healthChecker and register the available checks.

type LoadConfigParams

type LoadConfigParams struct {
	fx.In

	Provider config.Provider `optional:"true"`
}

Jump to

Keyboard shortcuts

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