Documentation
¶
Index ¶
- 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)
- type APIArgs
- type APIReply
- type Client
- func (c *Client) Health(ctx context.Context, tags []string, options ...rpc.Option) (*APIReply, error)
- func (c *Client) Liveness(ctx context.Context, tags []string, options ...rpc.Option) (*APIReply, error)
- func (c *Client) Readiness(ctx context.Context, tags []string, options ...rpc.Option) (*APIReply, error)
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AwaitAlive ¶
func AwaitAlive(ctx context.Context, c *Client, freq time.Duration, tags []string, options ...rpc.Option) (bool, error)
AwaitAlive polls the node every [freq] until the node reports liveness. Only returns an error if [ctx] returns an error.
Types ¶
type APIArgs ¶
type APIArgs struct {
Tags []string `json:"tags"`
}
APIArgs is the arguments for Readiness, Health, and Liveness.
type Client ¶
type Client struct {
Requester rpc.EndpointRequester
}
func (*Client) Health ¶
func (c *Client) Health(ctx context.Context, tags []string, options ...rpc.Option) (*APIReply, error)
Health returns a summation of the health of the node
type Result ¶
type Result struct {
// Details of the HealthCheck.
Details interface{} `json:"message,omitempty"`
// Error is the string representation of the error returned by the failing
// HealthCheck. The value is nil if the check passed.
Error *string `json:"error,omitempty"`
// Timestamp of the last HealthCheck.
Timestamp time.Time `json:"timestamp,omitempty"`
// Duration is the amount of time this HealthCheck last took to evaluate.
Duration time.Duration `json:"duration"`
// ContiguousFailures the HealthCheck has returned.
ContiguousFailures int64 `json:"contiguousFailures,omitempty"`
// TimeOfFirstFailure of the HealthCheck,
TimeOfFirstFailure *time.Time `json:"timeOfFirstFailure,omitempty"`
}
Result describes a single health check outcome.
Click to show internal directories.
Click to hide internal directories.