Versions in this module Expand all Collapse all v1 v1.11.13-rc.2 Dec 4, 2024 v1.0.0 Dec 4, 2024 Changes in this version + const AllTag + const ApplicationTag + func AwaitAlive(ctx context.Context, c Client, freq time.Duration, tags []string, ...) (bool, error) + func AwaitHealthy(ctx context.Context, c Client, freq time.Duration, tags []string, ...) (bool, error) + func AwaitReady(ctx context.Context, c Client, freq time.Duration, tags []string, ...) (bool, error) + func NewGetAndPostHandler(log logging.Logger, reporter Reporter) (http.Handler, error) + func NewGetHandler(reporter func(tags ...string) (map[string]Result, bool)) http.Handler + type APIArgs struct + Tags []string + type APIReply struct + Checks map[string]Result + Healthy bool + type Checker interface + HealthCheck func(context.Context) (interface{}, error) + type CheckerFunc func(context.Context) (interface{}, error) + func (f CheckerFunc) HealthCheck(ctx context.Context) (interface{}, error) + type Client interface + Health func(ctx context.Context, tags []string, options ...rpc.Option) (*APIReply, error) + Liveness func(ctx context.Context, tags []string, options ...rpc.Option) (*APIReply, error) + Readiness func(ctx context.Context, tags []string, options ...rpc.Option) (*APIReply, error) + func NewClient(uri string) Client + type Health interface + Start func(ctx context.Context, freq time.Duration) + Stop func() + func New(log logging.Logger, registerer prometheus.Registerer) (Health, error) + type Registerer interface + RegisterHealthCheck func(name string, checker Checker, tags ...string) error + RegisterLivenessCheck func(name string, checker Checker, tags ...string) error + RegisterReadinessCheck func(name string, checker Checker, tags ...string) error + type Reporter interface + Health func(tags ...string) (map[string]Result, bool) + Liveness func(tags ...string) (map[string]Result, bool) + Readiness func(tags ...string) (map[string]Result, bool) + type Result struct + ContiguousFailures int64 + Details interface{} + Duration time.Duration + Error *string + TimeOfFirstFailure *time.Time + Timestamp time.Time + type Service struct + func (s *Service) Health(_ *http.Request, args *APIArgs, reply *APIReply) error + func (s *Service) Liveness(_ *http.Request, args *APIArgs, reply *APIReply) error + func (s *Service) Readiness(_ *http.Request, args *APIArgs, reply *APIReply) error