Documentation ¶
Overview ¶
SPDX-FileCopyrightText: 2017 Comcast Cable Communications Management, LLC SPDX-License-Identifier: Apache-2.0
SPDX-FileCopyrightText: 2017 Comcast Cable Communications Management, LLC SPDX-License-Identifier: Apache-2.0
SPDX-FileCopyrightText: 2017 Comcast Cable Communications Management, LLC SPDX-License-Identifier: Apache-2.0
SPDX-FileCopyrightText: 2017 Comcast Cable Communications Management, LLC SPDX-License-Identifier: Apache-2.0
SPDX-FileCopyrightText: 2017 Comcast Cable Communications Management, LLC SPDX-License-Identifier: Apache-2.0
Index ¶
- func ApplyChecks(first *health.Config, rest ...*health.Config) func(ApplyChecksIn) error
- func New(o Options, logger *zap.Logger, listener health.IStatusListener) (health.IHealth, error)
- func NewHealthLoggerAdapter(logger *zap.Logger) healthlog.Logger
- func OnStart(logger *zap.Logger, h health.IHealth) func(context.Context) error
- func OnStop(logger *zap.Logger, h health.IHealth) func(context.Context) error
- func Unmarshal(configKey string) func(HealthIn) (HealthOut, error)
- type ApplyChecksIn
- type Handler
- type HealthIn
- type HealthOut
- type NopCheckable
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyChecks ¶ added in v0.0.3
ApplyChecks is an uber/fx Invoke function that allows checks created outside the uber/fx App to be registered with a Health component.
func New ¶
New constructs an IHealth instance for the given environment. If either the DisableLogging option field is set or the given logger is nil, logging will be disabled on the returned health object. The listener is optional.
func NewHealthLoggerAdapter ¶
NewHealthLoggerAdapter adapts a go-kit logger onto the go-logger package's logger interface
Types ¶
type HealthIn ¶
type HealthIn struct { fx.In // Logger is the required go-kit logger that will receive health logging output Logger *zap.Logger // Unmarshaller is the required configuration unmarshaller strategy Unmarshaller config.Unmarshaller // Lifecycle is used to bind the health service the the uber/fx App lifecycle Lifecycle fx.Lifecycle // StatusListener is the optional listener for health status changes StatusListener health.IStatusListener `optional:"true"` // Config is an optional check. If both this field and Configs are set, both fields // are added. Config *health.Config `optional:"true"` // Configs is an optional slice of checks. If both this field and Config are set, both // fields are added. Configs []*health.Config `optional:"true"` }
HealthIn defines the set of dependencies for instantiating an InVision health service and binding that service to the application lifecycle.
type NopCheckable ¶ added in v0.0.3
type NopCheckable struct {
Details interface{}
}
NopCheckable is an ICheckable that always returns success. This type is useful when an app only wants a health endpoint to indicate its own liveness, rather than checking any external dependencies.
func (NopCheckable) Status ¶ added in v0.0.3
func (nc NopCheckable) Status() (interface{}, error)
type Options ¶
type Options struct { // DisableLogging controls whether the created health service logs anything. The default is false, // meaning logging is enabled. DisableLogging bool // Custom is an optional map passed to NewHandler that is included in all responses to health checks Custom map[string]interface{} }
Options holds the available configuration options for the health infrastructure