wrapper

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotRetryable = errors.New("not retryable")

Functions

func WithErrorResult

func WithErrorResult(job func(context.Context) error, result func(error)) func(context.Context)

WithErrorResult is a job wrapper that allows to receive the error result of the job.

For example it can be used to build logging or monitoring pipelines on the job.

func WithRetry

func WithRetry(job func(context.Context) error, retries uint) func(context.Context)

WithRetry is a job wrapper that allows to retry a job if it returns an error.

If you consider than the error is not retryable you can either return nil or the custom "ErrNotRetryable".

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL