forked from ava-labs/avalanchego
-
Notifications
You must be signed in to change notification settings - Fork 4
/
result.go
40 lines (30 loc) · 1.04 KB
/
result.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package health
import (
"time"
)
// notYetRunResult is the result that is returned when a HealthCheck hasn't been
// run yet.
var notYetRunResult Result
func init() {
err := "not yet run"
notYetRunResult = Result{
Error: &err,
}
}
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"`
}