Documentation
¶
Index ¶
- Constants
- func GracefulExit(handler *Handler, wg *sync.WaitGroup)
- type Handler
- func (h *Handler) Add(label string, labelPos string, pos int, stop ServiceDescriptor)
- func (h *Handler) GenerateSeq(label string, pos int) int
- func (h *Handler) HealthcheckWithExistingConnections()
- func (h *Handler) InitHealthcheck()
- func (h *Handler) SetupHealthcheck(hc *Healthcheck)
- func (h *Handler) Stop() error
- type Healthcheck
- type HealthcheckConfig
- type HealthcheckDescriptor
- type Log
- type Ping
- type ServiceDescriptor
Constants ¶
View Source
const ( StatusServing int32 = iota StatusNotServing )
View Source
const ( Init = iota Before After )
Variables ¶
This section is empty.
Functions ¶
func GracefulExit ¶
Types ¶
type Handler ¶
type Handler struct { Healthcheck *Healthcheck // contains filtered or unexported fields }
func NewHandler ¶
func (*Handler) Add ¶
func (h *Handler) Add(label string, labelPos string, pos int, stop ServiceDescriptor)
func (*Handler) HealthcheckWithExistingConnections ¶
func (h *Handler) HealthcheckWithExistingConnections()
func (*Handler) InitHealthcheck ¶ added in v0.1.1
func (h *Handler) InitHealthcheck()
func (*Handler) SetupHealthcheck ¶
func (h *Handler) SetupHealthcheck(hc *Healthcheck)
type Healthcheck ¶
type Healthcheck struct {
// contains filtered or unexported fields
}
func NewHC ¶
func NewHC(config *HealthcheckConfig) *Healthcheck
func (*Healthcheck) Add ¶
func (h *Healthcheck) Add(name string, hcs HealthcheckDescriptor)
func (*Healthcheck) Policy ¶
func (h *Healthcheck) Policy() *HealthcheckConfig
func (*Healthcheck) Serve ¶
func (h *Healthcheck) Serve()
func (*Healthcheck) Status ¶
func (h *Healthcheck) Status() (int32, error)
type HealthcheckConfig ¶
type HealthcheckConfig struct { RetryAmount int `json:"retry_amount"` Interval int `json:"interval"` // in millisecond CheckInterval int `json:"check_interval"` // in millisecond }
func DefaultHealthcheckConfig ¶
func DefaultHealthcheckConfig() *HealthcheckConfig
type HealthcheckDescriptor ¶
type HealthcheckDescriptor interface {
Ping() error
}
type ServiceDescriptor ¶
Click to show internal directories.
Click to hide internal directories.