Documentation ¶
Index ¶
Constants ¶
const ( AppStatusUnhealthy uint8 = 0 AppStatusHealthy uint8 = 1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppHealth ¶
type AppHealth struct {
// contains filtered or unexported fields
}
AppHealth manages the health checks for the app.
func New ¶ added in v1.11.0
func New(config config.AppHealthConfig, probeFn ProbeFunction) *AppHealth
New creates a new AppHealth object.
func (*AppHealth) Enqueue ¶
func (h *AppHealth) Enqueue()
Enqueue adds a new probe request to the queue
func (*AppHealth) OnHealthChange ¶
func (h *AppHealth) OnHealthChange(cb ChangeCallback)
OnHealthChange sets the callback that is invoked when the health of the app changes (app becomes either healthy or unhealthy).
func (*AppHealth) ReportHealth ¶
ReportHealth is used by the runtime to report a health signal from the app.
type ChangeCallback ¶
ChangeCallback is the signature of the callback that is invoked when the app's health status changes.
type ProbeFunction ¶
ProbeFunction is the signature of the function that performs health probes. Health probe functions return errors only in case of internal errors. Network errors are considered probe failures, and should return nil as errors.