health

package
v0.3.47 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupHttpMux

func SetupHttpMux(mux *http.ServeMux, checker Checker)

TODO This function doesn't need to exist. Just return a callback function and let the caller decide what to do (e.g., register it to a mux).

Types

type CheckHttpHandler

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

TODO Doesn't need to exist. Just give a Checker directly.

func NewCheckHttpHandler

func NewCheckHttpHandler(checker Checker) *CheckHttpHandler

func (*CheckHttpHandler) ServeHTTP

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

TODO Is this really the way to do it? We could give a handler that is an anonymous function handle that encloses the relevant variables. In doing so, we don't need CheckHttpHandler, NewCheckHttpHandler.

type Checker

type Checker interface {
	Check() error
}

TODO No point in having this in a separate file. Just consolidate the health package into 1 or 2 files.

type MultiChecker

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

MultiChecker combines multiple Checker instances. Calls to MultiChecker.Check() calls Check() on each constituent checker and returns a new error created by joining any errors returned from those calls, or nil if no errors are found.

func NewMultiChecker

func NewMultiChecker(checkers ...Checker) *MultiChecker

func (*MultiChecker) Add

func (mc *MultiChecker) Add(checker Checker)

func (*MultiChecker) Check

func (mc *MultiChecker) Check() error

type StartupCompleteChecker

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

TODO Is the point of this system to make sure we can collect metrics (prometheus?) before the server has started?

func NewStartupCompleteChecker

func NewStartupCompleteChecker() *StartupCompleteChecker

func (*StartupCompleteChecker) Check

func (checker *StartupCompleteChecker) Check() error

func (*StartupCompleteChecker) MarkComplete

func (checker *StartupCompleteChecker) MarkComplete()

Jump to

Keyboard shortcuts

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