2019-09-07 02:25:31 +02:00
|
|
|
package core
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
2020-10-05 01:49:02 +02:00
|
|
|
// Result of the evaluation of a Service
|
2019-09-07 02:25:31 +02:00
|
|
|
type Result struct {
|
2020-10-23 22:29:20 +02:00
|
|
|
// HTTPStatus is the HTTP response status code
|
|
|
|
HTTPStatus int `json:"status"`
|
2020-10-05 01:49:02 +02:00
|
|
|
|
2020-11-27 00:09:01 +01:00
|
|
|
// DNSRCode is the response code of a DNS query in a human readable format
|
2020-11-30 15:40:57 +01:00
|
|
|
DNSRCode string `json:"-"`
|
2020-11-18 00:55:31 +01:00
|
|
|
|
2020-10-05 01:49:02 +02:00
|
|
|
// Body is the response body
|
|
|
|
Body []byte `json:"-"`
|
|
|
|
|
2020-10-23 22:29:20 +02:00
|
|
|
// Hostname extracted from the Service URL
|
2020-10-05 01:49:02 +02:00
|
|
|
Hostname string `json:"hostname"`
|
|
|
|
|
2020-10-23 22:29:20 +02:00
|
|
|
// IP resolved from the Service URL
|
|
|
|
IP string `json:"-"`
|
2020-10-05 01:49:02 +02:00
|
|
|
|
|
|
|
// Connected whether a connection to the host was established successfully
|
|
|
|
Connected bool `json:"-"`
|
|
|
|
|
|
|
|
// Duration time that the request took
|
|
|
|
Duration time.Duration `json:"duration"`
|
|
|
|
|
|
|
|
// Errors encountered during the evaluation of the service's health
|
|
|
|
Errors []string `json:"errors"`
|
|
|
|
|
|
|
|
// ConditionResults results of the service's conditions
|
2019-09-12 22:15:42 +02:00
|
|
|
ConditionResults []*ConditionResult `json:"condition-results"`
|
2020-10-05 01:49:02 +02:00
|
|
|
|
|
|
|
// Success whether the result signifies a success or not
|
|
|
|
Success bool `json:"success"`
|
|
|
|
|
|
|
|
// Timestamp when the request was sent
|
|
|
|
Timestamp time.Time `json:"timestamp"`
|
2020-11-15 18:33:09 +01:00
|
|
|
|
|
|
|
// CertificateExpiration is the duration before the certificate expires
|
2020-11-30 15:40:57 +01:00
|
|
|
CertificateExpiration time.Duration `json:"-"`
|
2019-09-07 02:25:31 +02:00
|
|
|
}
|