Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Description describes which functionality this health check implements. Description = "Ensure service availability." // Name is the identifier of the health check. This can be used for emitting // metrics. Name = "service" // SuccessMessage is the message returned in case the health check did not // fail. SuccessMessage = "Service up." )
Variables ¶
This section is empty.
Functions ¶
func IsInvalidConfig ¶
IsInvalidConfig asserts invalidConfigError.
Types ¶
type Config ¶
type Config struct {
Logger micrologger.Logger
}
Config represents the configuration used to create a healthz service.
type Healthz ¶
type Healthz struct {
// contains filtered or unexported fields
}
Healthz implements the health service.
type Response ¶
type Response struct { Description string `json:"description" yaml:"description"` Failed bool `json:"failed" yaml:"failed"` Message string `json:"message" yaml:"message"` Name string `json:"name" yaml:"name"` }
Response is the response structure each health check returns.
type Service ¶
type Service interface { // GetHealthz executes the health check business logic. It always returns a // response structure containing information about the system state it checks. // GetHealthz only returns an error in case it cannot create its response // structure properly. This implies that failed health checks must not be // represented by an error being returned, but by the response structure // itself. GetHealthz(ctx context.Context) (Response, error) }
Service describes how an implementation of a health check has to be done.
Click to show internal directories.
Click to hide internal directories.