Documentation ¶
Index ¶
- func FromHealthCheckSource(ctx context.Context, gracePeriod time.Duration, retryInterval time.Duration, ...) status.HealthCheckSource
- func NewHealthCheckSource(ctx context.Context, gracePeriod time.Duration, retryInterval time.Duration, ...) status.HealthCheckSource
- type CheckFunc
- type Option
- type Source
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromHealthCheckSource ¶ added in v1.6.7
func FromHealthCheckSource(ctx context.Context, gracePeriod time.Duration, retryInterval time.Duration, source Source, options ...Option) status.HealthCheckSource
FromHealthCheckSource creates a health check source that calls the the provided Source.Checks functions every retryInterval in a goroutine. The goroutine is cancelled if ctx is cancelled. For each check, if gracePeriod elapses without CheckFunc returning HEALTHY, the returned health check source's HealthStatus will return a HealthCheckResult of error.
func NewHealthCheckSource ¶
func NewHealthCheckSource(ctx context.Context, gracePeriod time.Duration, retryInterval time.Duration, checkType health.CheckType, poll func() error, options ...Option) status.HealthCheckSource
NewHealthCheckSource creates a health check source that calls poll every retryInterval in a goroutine. The goroutine is cancelled if ctx is cancelled. If gracePeriod elapses without poll returning nil, the returned health check source will give a health status of error. checkType is the key to be used in the health result returned by the health check source.
Types ¶
type Option ¶ added in v1.7.0
type Option interface {
// contains filtered or unexported methods
}
func WithInitialPoll ¶ added in v1.7.0
func WithInitialPoll() Option
WithInitialPoll configures the health check source to poll immediately instead of waiting for the duration of the check's specified retry interval.
func WithStartupGracePeriod ¶ added in v1.20.0
WithStartupGracePeriod configures the health check source to transform all ERROR results into REPAIRING results for the first startupGracePeriod time window. The default value of the startup grace period is the window grace period.