health

package
v1.5.3-rc.9 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: BSD-3-Clause Imports: 11 Imported by: 40

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIHealthArgs added in v1.2.1

type APIHealthArgs struct{}

APIHealthArgs are the arguments for Health

type APIHealthReply added in v1.2.1

type APIHealthReply struct {
	Checks  map[string]health.Result `json:"checks"`
	Healthy bool                     `json:"healthy"`
}

APIHealthReply is the response for Health

type Client added in v1.0.6

type Client struct {
	// contains filtered or unexported fields
}

Client for Avalanche Health API Endpoint

func NewClient added in v1.0.6

func NewClient(uri string, requestTimeout time.Duration) *Client

NewClient returns a client to interact with Health API endpoint

func (*Client) AwaitHealthy added in v1.0.6

func (c *Client) AwaitHealthy(checks int, interval time.Duration) (bool, error)

AwaitHealthy queries the GetLiveness endpoint [checks] times, with a pause of [interval] in between checks and returns early if GetLiveness returns healthy

func (*Client) GetLiveness added in v1.0.6

func (c *Client) GetLiveness() (*APIHealthReply, error)

GetLiveness returns a health check on the Avalanche node

func (*Client) Health added in v1.2.1

func (c *Client) Health() (*APIHealthReply, error)

Health returns a health check on the Avalanche node

type Service added in v1.2.1

type Service interface {
	healthlib.Service
	Handler() (*common.HTTPHandler, error)
}

Service wraps a healthlib.Service. Handler() returns a handler that handles incoming HTTP API requests. We have this in a separate package from healthlib to avoid a circular import where this service imports snow/engine/common but that package imports healthlib.Checkable

func NewNoOpService added in v1.1.1

func NewNoOpService() Service

NewNoOpService returns a NoOp version of health check for when the Health API is disabled

func NewService

func NewService(checkFreq time.Duration, log logging.Logger, namespace string, registry prometheus.Registerer) (Service, error)

Jump to

Keyboard shortcuts

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