xhealth

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2019 License: Apache-2.0 Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(o Options, logger log.Logger, listener health.IStatusListener) (health.IHealth, error)

New constructs an IHealth instance for the given environment

func NewHealthLoggerAdapter

func NewHealthLoggerAdapter(logger kitlog.Logger) healthlog.Logger

NewHealthLoggerAdapter adapts a go-kit logger onto the go-logger package's logger interface

func OnStart

func OnStart(logger log.Logger, h health.IHealth) func(context.Context) error

OnStart returns an uber/fx Lifecycle hook for startup

func OnStop

func OnStop(logger log.Logger, h health.IHealth) func(context.Context) error

OnStop returns an uber/fx Lifecycle hook for shutdown

func Unmarshal

func Unmarshal(configKey string) func(HealthIn) (HealthOut, error)

Unmarshal returns an uber/fx provider that reads configuration from a Viper instance and initializes the health infrastructure.

Types

type Handler

type Handler http.Handler

func NewHandler

func NewHandler(h health.IHealth, custom map[string]interface{}) Handler

type HealthIn

type HealthIn struct {
	fx.In

	Logger         log.Logger
	Unmarshaller   config.Unmarshaller
	Lifecycle      fx.Lifecycle
	StatusListener health.IStatusListener `optional:"true"`
}

type HealthOut

type HealthOut struct {
	fx.Out

	Health  health.IHealth
	Handler Handler
}

type Options

type Options struct {
	DisableLogging bool
	Custom         map[string]interface{}
}

Options holds the available configuration options for the health infrastructure

Jump to

Keyboard shortcuts

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