Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Checker ¶
type Checker interface {
Check(ctx context.Context, id fmt.Stringer, check func(context.Context) (bool, error)) (ReadyStatus, error)
}
Checker checks readiness and returns a Status. It may be a single probe, watch or a polling wait, depending on implementation.
type Poller ¶
type Poller struct {
// contains filtered or unexported fields
}
Poller repeatedly calls the underlying Checker at the configured period until Ready, Error, or context cancellation/timeout. prober := readiness.NewProber(1 * time.Minute) // single-check timeout poller := readiness.NewPoller(5*time.Second, prober) // polling loop
type Prober ¶
type Prober struct {
// contains filtered or unexported fields
}
Prober performs a single readiness check and returns Ready/InProgress/Error. Each check is bounded by the timeout configured in the constructor.
Usage:
status, err := readiness.NewProber(time.Minute).Check(ctx, id, fn)
type ReadyStatus ¶
type ReadyStatus int
const ( InProgress ReadyStatus = iota Ready Error )
func (ReadyStatus) AsFuncResult ¶
func (r ReadyStatus) AsFuncResult(err error) (bool, error)
func (ReadyStatus) Failed ¶
func (r ReadyStatus) Failed() bool
func (ReadyStatus) IsNotReady ¶
func (r ReadyStatus) IsNotReady() bool
func (ReadyStatus) IsReady ¶
func (r ReadyStatus) IsReady() bool
Click to show internal directories.
Click to hide internal directories.