micro/debug/health/health.go

29 lines
504 B
Go
Raw Normal View History

2019-05-31 03:22:19 +03:00
// Package health is for user defined health checks
package health
type Health interface {
Register([]*Check) error
Read(...ReadOption) ([]*Check, error)
Check(...CheckOption) ([]*Status, error)
String() string
}
type Check struct {
Id string
Metadata map[string]string
Exec func() (*Status, error)
}
type Status struct {
Code int
Detail string
}
type CheckOptions struct{}
type CheckOption func(o *CheckOptions)
type ReadOptions struct{}
type ReadOption func(o *ReadOptions)