Versions in this module Expand all Collapse all v1 v1.9.8 Jun 28, 2023 Changes in this version + func AwaitAlive(ctx context.Context, c Client, freq time.Duration, options ...rpc.Option) (bool, error) + func AwaitHealthy(ctx context.Context, c Client, freq time.Duration, options ...rpc.Option) (bool, error) + func AwaitReady(ctx context.Context, c Client, freq time.Duration, options ...rpc.Option) (bool, error) + func NewGetAndPostHandler(log logging.Logger, reporter Reporter) (http.Handler, error) + func NewGetHandler(reporter func() (map[string]Result, bool)) http.Handler + 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(context.Context, ...rpc.Option) (*APIReply, error) + Liveness func(context.Context, ...rpc.Option) (*APIReply, error) + Readiness func(context.Context, ...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) error + RegisterLivenessCheck func(name string, checker Checker) error + RegisterReadinessCheck func(name string, checker Checker) error + type Reporter interface + Health func() (map[string]Result, bool) + Liveness func() (map[string]Result, bool) + Readiness func() (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, _ *struct{}, reply *APIReply) error + func (s *Service) Liveness(_ *http.Request, _ *struct{}, reply *APIReply) error + func (s *Service) Readiness(_ *http.Request, _ *struct{}, reply *APIReply) error v1.9.8-rc.9 Jun 28, 2023