health

package
v0.0.0-...-cf8a7de Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReadinessHandler

func NewReadinessHandler() http.Handler

NewReadinessHandler returns a handler that, if you can reach it says that everything is hunky-dory.

Types

type CheckFn

type CheckFn func(context.Context, *log.Logger) error

type Handler

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

func NewHandler

func NewHandler(ctx context.Context) *Handler

func (*Handler) AddCheck

func (h *Handler) AddCheck(check *HealthCheck) error

func (*Handler) Close

func (h *Handler) Close()

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Handler) SetFailed

func (h *Handler) SetFailed(msg string)

func (*Handler) Start

func (h *Handler) Start(logger *log.Logger)

type HealthCheck

type HealthCheck struct {
	ID          string
	Fn          func(context.Context, *log.Logger) error
	Interval    time.Duration
	Timeout     time.Duration
	MaxFailures int
}

Jump to

Keyboard shortcuts

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