Documentation ¶
Index ¶
Constants ¶
View Source
const ( MetricOnline = "service.health" // current status MetricStatus = "service.health.status" )
Variables ¶
This section is empty.
Functions ¶
func SemVersion ¶
func SemVersion() string
SemVersion is the semantic version to be supplied to tracer/meter creation.
Types ¶
type Checker ¶
type Checker interface {
Check(context.Context) ReportDocument
}
Checker is interface used to provide an indication of application health.
type CheckerFunc ¶
type CheckerFunc func(ctx context.Context) ReportDocument
CheckerFunc is an adapter to allow the use of ordinary go functions as Checkers.
func (CheckerFunc) Check ¶
func (f CheckerFunc) Check(ctx context.Context) ReportDocument
type Controller ¶
Controller of checker set
type Handler ¶
type Handler struct {
Controller
}
type Report ¶
type Report struct {
// contains filtered or unexported fields
}
Report is a health State struct
func (*Report) MarshalJSON ¶
MarshalJSON is a custom JSON marshaller for pretty http json body
type ReportDocument ¶
type ReportDocument interface {
IsOnline() bool
}
type ReportDocumentList ¶
type ReportDocumentList []ReportDocument
func (ReportDocumentList) IsOnline ¶
func (l ReportDocumentList) IsOnline() bool
IsOnline check if any check if down we should declare service is not ready
type Simple ¶
type Simple struct {
// contains filtered or unexported fields
}
Simple aggregate a list of Checkers
func (*Simple) AddChecker ¶
AddChecker add a Checker to the aggregator
Click to show internal directories.
Click to hide internal directories.