Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ByPercentage counter type ByPercentage = iota // Sequential counter type Sequential )
View Source
const ( // Critical severity Critical = iota // Degraded severity Degraded // Low severity Low )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
CounterType int
MaxErrorsAllowed int
MinSuccessExpected int
MaxLen int
PercentageToBeHealthy int
Name string
ServiceURL string
ServiceHealthEndpoint string
Severity int
TaskPeriod int
}
Config counter config
type CounterInterface ¶
type CounterInterface interface {
NotifyServiceHit(statusCode int, message string)
IsHealthy() HealthyResult
Start()
Stop()
}
CounterInterface interface
type HealthDto ¶
type HealthDto struct {
Status string `json:"serviceStatus"`
Items []ItemDto `json:"dependencies"`
}
HealthDto description
type HealthyResult ¶
type HealthyResult struct {
Name string
Severity int
Healthy bool
LastMessage string
HealthySince *time.Time
LastHit *time.Time
}
HealthyResult result
type ItemDto ¶
type ItemDto struct {
Service string `json:"service"`
Healthy bool `json:"healthy"`
Message string `json:"message,omitempty"`
HealthySince *time.Time `json:"healthySince,omitempty"`
LastHit *time.Time `json:"lastHit,omitempty"`
}
ItemDto description
type MonitorInterface ¶
type MonitorInterface interface {
Start()
Stop()
GetHealthStatus() HealthDto
}
MonitorInterface services monitor interface
Click to show internal directories.
Click to hide internal directories.