Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CheckResult ¶
type CheckResult struct { CheckName string `json:"name"` Status Status `json:"status"` Error string `json:"error,omitempty"` Extra []string `json:"extra,omitempty"` }
func Ok ¶
func Ok(checkName string, extra []string) CheckResult
func Unhealthy ¶
func Unhealthy(checkName, errorDetails string, extra []string) CheckResult
type Checker ¶
type Checker interface { Name() string TimeoutSeconds() int Run(c chan CheckResult) }
To create a check without an asynchronous timeout, return 0 for TimeoutSeconds() To create a simple check, you can call CreateHealthCheck or CreateHealthCheckWithTimeout For more control, create your own implementation of the Checker interface
func CreateHealthCheck ¶
func CreateHealthCheck(name string, run HealthCheckFunc) Checker
func CreateHealthCheckWithTimeout ¶
func CreateHealthCheckWithTimeout(name string, timeoutSeconds int, run HealthCheckFunc) Checker
type Health ¶
type Health struct { ServiceName string `json:"serviceName"` Checks map[string]CheckResult `json:"checks"` Unhealthy bool `json:"-"` }
func CreateResponse ¶
func (*Health) AddResult ¶
func (s *Health) AddResult(result CheckResult)
type HealthCheckFunc ¶
type HealthCheckFunc func(name string, out chan CheckResult)
Click to show internal directories.
Click to hide internal directories.