xtask

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(ctx context.Context, do func() error, deferFunc func()) (err error)

Do fn with ctx control.

func DoWithRetry added in v0.1.9

func DoWithRetry(fn func() error, opts ...RetryOption) error

DoWithRetry runs fn, and retries if failed. Default to retry 3 times.

func DoWithTimeout

func DoWithTimeout(timeout time.Duration, do func() error, deferFunc func()) error

DoWithTimeout fn with timeout control.

func DoWithoutDefer added in v0.1.8

func DoWithoutDefer(ctx context.Context, do func() error) error

DoWithoutDefer fn with ctx control, but not defer.

Types

type RetryOption added in v0.1.9

type RetryOption func(*retryOptions)

RetryOption defines the method to customize DoWithRetry.

func WithRetry added in v0.1.9

func WithRetry(times int) RetryOption

WithRetry customize a DoWithRetry call with given retry times.

Jump to

Keyboard shortcuts

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