Documentation
¶
Index ¶
- Variables
- type BreakPredicate
- type Loop
- func (l *Loop) BreakIf(pred BreakPredicate) *Loop
- func (l *Loop) Run(task func() error) error
- func (l *Loop) RunContext(ctx context.Context, task func() error) error
- func (l *Loop) WithInterruptable(flag bool) *Loop
- func (l *Loop) WithLogger(logger log.Logger) *Loop
- func (l *Loop) WithShowError(flag bool) *Loop
Constants ¶
This section is empty.
Variables ¶
View Source
var InTestEnvironment = false
Functions ¶
This section is empty.
Types ¶
type BreakPredicate ¶
func IsErr ¶
func IsErr(err error) BreakPredicate
type Loop ¶
type Loop struct {
// contains filtered or unexported fields
}
Loop retries a task function until it succeeded with number of attempts and delay between runs are adjustable.
func NewLoop ¶
NewLoop create Loop with features: - it is "verbose" loop — it prints messages through logboek. - this loop is interruptable by the signal watcher in tomb package.
func NewSilentLoop ¶
NewSilentLoop create Loop with features: - it is "silent" loop — no messages are printed through logboek. - this loop is not interruptable by the signal watcher in tomb package.
func (*Loop) BreakIf ¶
func (l *Loop) BreakIf(pred BreakPredicate) *Loop
func (*Loop) RunContext ¶
RunContext retries a task like Run but breaks if context done.
func (*Loop) WithInterruptable ¶
func (*Loop) WithShowError ¶
Click to show internal directories.
Click to hide internal directories.