Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WaitForTestDial ¶ added in v0.12.2
WaitForTestDial tries to create a client connection to the given target with a blocking dial and a timeout specified in testDialTimeout. Nothing is done with the connection, which is just closed in case it is created.
Types ¶
type Checkable ¶ added in v1.0.0
type Checkable interface {
CheckHealth() State
}
Checkable is the interface implemented by subsystems that the checker uses to determine subsystem health.
type Checker ¶
Checker is responsible for running health checks and serving the healthcheck HTTP paths
type Config ¶
type Config struct { ListenerEnabled bool `hcl:"listener_enabled"` // Address and port to listen on, defaulting to localhost:80 BindAddress string `hcl:"bind_address"` BindPort string `hcl:"bind_port"` // Paths for /ready and /live ReadyPath string `hcl:"ready_path"` LivePath string `hcl:"live_path"` UnusedKeyPositions map[string][]token.Pos `hcl:",unusedKeyPositions"` }
type Details ¶ added in v0.12.2
type Details struct {
Message string `json:"message,omitempty"`
}
Details are additional data to be used when the system is ready
type ServableChecker ¶ added in v1.0.0
func NewChecker ¶
func NewChecker(config Config, log logrus.FieldLogger) ServableChecker
type State ¶ added in v1.0.0
type State struct { // Live is whether or not the subsystem is live (i.e. in a good state // or in a state it can recover from while remaining alive). Global // liveness is only reported true if all subsystems report live. Live bool // Ready is whether or not the subsystem is ready (i.e. ready to perform // its function). Global readiness is only reported true if all subsystems // report ready. Ready bool // Subsystems can return whatever details they want here as long as it is // serializable via json.Marshal. // LiveDetails are opaque details related to the live check. LiveDetails interface{} // ReadyDetails are opaque details related to the live check. ReadyDetails interface{} }
State is the health state of a subsystem.
Click to show internal directories.
Click to hide internal directories.