health

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoint

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

Endpoint for liveness and readiness checks.

architecture: Endpoint

func NewEndpoint

func NewEndpoint(log *zap.Logger, db Pingable, tokenPrice *tokenprice.Service, tokenService *tokens.Service) *Endpoint

NewEndpoint creates a new endpoint instance for the health checker.

func (*Endpoint) Live

func (endpoint *Endpoint) Live(w http.ResponseWriter, r *http.Request)

Live checks if the storjscan service is running.

func (*Endpoint) Ready

func (endpoint *Endpoint) Ready(w http.ResponseWriter, r *http.Request)

Ready checks whether the database connection is available and whether the token price and blockchain services are reachable. Returns 503 if database is unreachable. Sends a metric if either token price or blockchain services are unreachable. 200 indicates that the storjscan service is ready for use.

func (*Endpoint) Register

func (endpoint *Endpoint) Register(router *mux.Router)

Register registers endpoint methods on API server subroute.

type Pingable

type Pingable interface {
	Ping(ctx context.Context) error
}

Pingable allows access to the storjscandb.

Jump to

Keyboard shortcuts

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