health

package
v0.22.7 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Default Health Configuration
	LivenessPath  = "/healthz" // The Endpoint Of The Liveness Check
	ReadinessPath = "/healthy" // The Endpoint Of The Readiness Check
)

Constants

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	HttpPort string // The HTTP Port The Dispatcher Server Listens On
	// contains filtered or unexported fields
}

Structure Containing Basic Liveness Information For Health Server

func NewHealthServer

func NewHealthServer(httpPort string, healthStatus Status) *Server

Creates A New Server With Specified Configuration

func (*Server) Alive

func (hs *Server) Alive() bool

Access Function For "alive" Flag

func (*Server) HandleLiveness

func (hs *Server) HandleLiveness(responseWriter http.ResponseWriter, request *http.Request)

HTTP Request Handler For Liveness Requests (/healthz)

func (*Server) HandleReadiness

func (hs *Server) HandleReadiness(responseWriter http.ResponseWriter, request *http.Request)

HTTP Request Handler For Readiness Requests (/healthy)

func (*Server) SetAlive

func (hs *Server) SetAlive(isAlive bool)

Synchronized Function To Set Liveness Flag

func (*Server) Shutdown

func (hs *Server) Shutdown()

Set All Liveness And Readiness Flags To False

func (*Server) Start

func (hs *Server) Start(logger *zap.Logger) error

Start The HTTP Server (Blocking Call)

func (*Server) Stop

func (hs *Server) Stop(logger *zap.Logger)

Stop The HTTP Server Listening For Requests

type Status

type Status interface {
	Alive() bool
	Ready() bool
}

Interface For Providing Overrides For Liveness And Readiness Information

Jump to

Keyboard shortcuts

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