Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisableColor ¶
func DisableColor()
DisableColor disables ANSI colors in the Result default string.
Types ¶
type Errors ¶
type Errors []error
Errors is an error type that concatenates multiple errors.
type ProvisionInfo ¶
type ProvisionInfo struct {
// The ID of a user that was created for accessing checks.
UserID string `json:"user_id"`
// The username of a user that was created for accessing checks.
Username string `json:"username"`
// The ID or name of the ID/key used to access checks. Expect
// this value to be made public. (It should have read-only
// access to the checks.)
PublicAccessKeyID string `json:"public_access_key_id"`
// The "secret" associated with the PublicAccessKeyID, but
// expect this value to be made public. (It should provide
// read-only access to the checks.)
PublicAccessKey string `json:"public_access_key"`
}
ProvisionInfo contains the results of provisioning a new storage facility for check files. Its values should be used by the status page in order to obtain read-only access to the check files.
func (ProvisionInfo) String ¶
func (i ProvisionInfo) String() string
String returns the information in i in a human-readable format along with an important notice.
type Result ¶
type Result struct {
// Title is the title (or name) of the thing that was checked.
// It should be unique, as it acts like an identifier to users.
Title string `json:"title,omitempty"`
// Endpoint is the URL/address/path/identifier/locator/whatever
// of what was checked.
Endpoint string `json:"endpoint,omitempty"`
// Timestamp is when the check occurred; UTC UnixNano format.
Timestamp int64 `json:"timestamp,omitempty"`
// Times is a list of each individual check attempt.
Times Attempts `json:"times,omitempty"`
// ThresholdRTT is the maximum RTT that was tolerated before
// considering performance to be degraded. Leave 0 if irrelevant.
ThresholdRTT time.Duration `json:"threshold,omitempty"`
// Healthy, Degraded, and Down contain the ultimate conclusion
// about the endpoint. Exactly one of these should be true;
// any more or less is a bug.
Healthy bool `json:"healthy,omitempty"`
Degraded bool `json:"degraded,omitempty"`
Down bool `json:"down,omitempty"`
// Notice contains a description of some condition of this
// check that might have affected the result in some way.
// For example, that the median RTT is above the threshold.
Notice string `json:"notice,omitempty"`
// Message is an optional message to show on the status page.
// For example, what you're doing to fix a problem.
Message string `json:"message,omitempty"`
}
Result is the result of a health check.
func (Result) ComputeStats ¶
ComputeStats computes basic statistics about r.
func (Result) Status ¶
func (r Result) Status() StatusText
Status returns a text representation of the overall status indicated in r.
type Stats ¶
type Stats struct {
Total time.Duration `json:"total,omitempty"`
Mean time.Duration `json:"mean,omitempty"`
Median time.Duration `json:"median,omitempty"`
Min time.Duration `json:"min,omitempty"`
Max time.Duration `json:"max,omitempty"`
}
Stats is a type that holds information about a Result, especially its various Attempts.
type StatusText ¶
type StatusText string
StatusText is the textual representation of the result of a status check.
const ( StatusHealthy StatusText = "healthy" StatusDegraded StatusText = "degraded" StatusDown StatusText = "down" StatusUnknown StatusText = "unknown" )
Text representations for the status of a check.
func (StatusText) PriorityOver ¶
func (s StatusText) PriorityOver(other StatusText) bool
PriorityOver returns whether s has priority over other. For example, a Down status has priority over Degraded.