zfunc

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ContextCancelErr = errors.New("context cancel error")
View Source
var TimeoutErr = errors.New("timeout error")

Functions

func Run

func Run(f func() error, options ...Option) error

Run is general func run controller When timeout Run func end with all goroutine on stack destroyed

Types

type Option

type Option func(*runConfig)

********************************auto generate****************************** Option is a runConfig configurator to be supplied to NewrunConfig() function.

func WithCtx

func WithCtx(ctx context.Context) Option

WithCtx sets the Ctx

func WithDelay

func WithDelay(delay time.Duration) Option

WithDelay sets the Delay

func WithRetries

func WithRetries(retries int) Option

WithDelay sets the Delay

func WithTimeout

func WithTimeout(timeout time.Duration) Option

WithTimeout sets the Timeout

Jump to

Keyboard shortcuts

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