health

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIArgs

type APIArgs struct {
	Tags []string `json:"tags"`
}

APIArgs is the arguments for Readiness, Health, and Liveness.

type APIReply

type APIReply struct {
	Checks  map[string]Result `json:"checks"`
	Healthy bool              `json:"healthy"`
}

APIReply is the response for Readiness, Health, and Liveness.

type Result

type Result struct {
	Details            interface{}   `json:"message,omitempty"`
	Error              *string       `json:"error,omitempty"`
	Timestamp          time.Time     `json:"timestamp,omitempty"`
	Duration           time.Duration `json:"duration"`
	ContiguousFailures int64         `json:"contiguousFailures,omitempty"`
	TimeOfFirstFailure *time.Time    `json:"timeOfFirstFailure,omitempty"`
}

Result describes a health check result.

type Service

type Service interface {
	Readiness(ctx context.Context, args *APIArgs) (*APIReply, error)
	Health(ctx context.Context, args *APIArgs) (*APIReply, error)
	Liveness(ctx context.Context, args *APIArgs) (*APIReply, error)
}

Service defines the health API contract.

Jump to

Keyboard shortcuts

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