Documentation ¶
Index ¶
Constants ¶
View Source
const ( StatusUp = "UP" StatusDown = "DOWN" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultHealthService ¶
type DefaultHealthService struct {
// contains filtered or unexported fields
}
type DefaultInfoService ¶
type DefaultInfoService struct {
// contains filtered or unexported fields
}
func (DefaultInfoService) Info ¶
func (d DefaultInfoService) Info() Info
type Health ¶
type Health struct { Status string `json:"status"` Components map[string]StatusDetails `json:"components,omitempty"` }
Health is a model represents for service health status. Includes Status UP or DOWN (see StatusUp, StatusDown), and a map of Components under test (with key is component name, value is StatusDetails)
type HealthChecker ¶
type HealthChecker interface { // Component returns the name of // component under test Component() string // Check status of current component, // Return status details includes status: UP or DOWN, // and the reason if it's down Check(ctx context.Context) StatusDetails }
HealthChecker is an interface that implemented by component
type HealthService ¶
func NewDefaultHealthService ¶
func NewDefaultHealthService(checkers []HealthChecker) HealthService
type Info ¶
type Info struct { Name string `json:"service_name"` Info map[string]interface{} `json:"info,omitempty"` }
Info is a model represents for service info. Includes Name is the service name and a map of Info with key and value
type InfoService ¶
type InfoService interface {
Info() Info
}
func NewDefaultInfoService ¶
func NewDefaultInfoService(props *config.AppProperties, informers []Informer) InfoService
type Informer ¶
type Informer interface { // Key returns the key of this information Key() string // Value returns the value of this information Value() interface{} }
Informer is an interface that implemented by component to provide their information
type StatusDetails ¶
StatusDetails is a model represents for component's status. Includes status UP or DOWN (see StatusUp, StatusDown), and the reason if it's down
Click to show internal directories.
Click to hide internal directories.