health

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckDetails

type CheckDetails struct {
	OK               bool
	Errors           []string
	RunDuration      string
	Namespace        string
	LastRun          time.Time // the time the check last was last run
	AuthoritativePod string    // the pod that last ran the check
	CurrentUUID      string    `json:"uuid"` // the UUID that is authorized to report statuses into the kuberhealthy endpoint
}

CheckDetails contains details about a single check's current status

func NewCheckDetails

func NewCheckDetails() CheckDetails

NewCheckDetails creates a new CheckDetails struct

type State

type State struct {
	OK            bool
	Errors        []string
	CheckDetails  map[string]CheckDetails // map of check names to last run timestamp
	CurrentMaster string
}

State represents the results of all checks being managed along with a top-level OK and Error state. This is displayed on the kuberhealthy status page as JSON

func NewState

func NewState() State

NewState creates a new health check result response

func (*State) AddError

func (h *State) AddError(s ...string)

AddError adds new errors to State

func (*State) WriteHTTPStatusResponse

func (h *State) WriteHTTPStatusResponse(w http.ResponseWriter) error

WriteHTTPStatusResponse writes a response to an http response writer

Jump to

Keyboard shortcuts

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