health

package
v1.1.13 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: BSD-3-Clause Imports: 5 Imported by: 4

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.

func (*APIArgs) MarshalZAP added in v1.1.13

func (x *APIArgs) MarshalZAP() ([]byte, error)

MarshalZAP writes APIArgs from constant offsets.

func (*APIArgs) UnmarshalZAP added in v1.1.13

func (x *APIArgs) UnmarshalZAP(data []byte) error

UnmarshalZAP reads APIArgs out of the buffer that arrived.

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