Documentation
¶
Index ¶
- func Do(functions ...FuncMayError) error
- func Foreach(slice interface{}, f func(i int, v interface{}) error) error
- func Go(f FuncWithResultMayError, options ...GoOption)
- func Merge(eachFuncs []FuncWithResultMayError, merge MergeFunc) error
- func MergeForeach(slice interface{}, f func(i int, v interface{}) (interface{}, error), ...) error
- type EachFunc
- type Func
- type FuncMayError
- type FuncWithResult
- type FuncWithResultMayError
- type GoOption
- func WithErrorHandler(f func(err error)) GoOption
- func WithLimiter(l *Limiter) GoOption
- func WithRecoverPanic(f func(p interface{})) GoOption
- func WithResultHandler(f func(result interface{})) GoOption
- func WithSkipNilFunc(skip bool) GoOption
- func WithWaitGroup(wg *sync.WaitGroup) GoOption
- func WithWrapper(w func(f FuncWithResultMayError) FuncWithResultMayError, checkFuncNil bool) GoOption
- type GoOptions
- type Limiter
- type MergeFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Do ¶
func Do(functions ...FuncMayError) error
func Go ¶ added in v0.2.9
func Go(f FuncWithResultMayError, options ...GoOption)
func Merge ¶ added in v0.1.2
func Merge(eachFuncs []FuncWithResultMayError, merge MergeFunc) error
Types ¶
type FuncMayError ¶
type FuncMayError func() error
type FuncWithResult ¶ added in v0.2.9
type FuncWithResult func() (result interface{})
type FuncWithResultMayError ¶ added in v0.2.9
type FuncWithResultMayError func() (result interface{}, err error)
type GoOption ¶ added in v0.2.9
type GoOption func(*GoOptions)
func WithErrorHandler ¶ added in v0.2.9
func WithLimiter ¶ added in v0.2.9
func WithRecoverPanic ¶ added in v0.2.9
func WithRecoverPanic(f func(p interface{})) GoOption
nil to not recover
func WithResultHandler ¶ added in v0.2.9
func WithResultHandler(f func(result interface{})) GoOption
func WithSkipNilFunc ¶ added in v0.2.9
func WithWaitGroup ¶ added in v0.2.9
func WithWrapper ¶ added in v0.2.9
func WithWrapper(w func(f FuncWithResultMayError) FuncWithResultMayError, checkFuncNil bool) GoOption
set checkFuncNil to return nil when f is nil
type GoOptions ¶ added in v0.2.9
type GoOptions struct {
// contains filtered or unexported fields
}
type Limiter ¶ added in v0.1.2
type Limiter struct {
// contains filtered or unexported fields
}
wrap sync.Cond on a uint, use to limit concurrent
zero value is not read to use, use NewLimiter to create a nil *Limiter is a noop Limiter
func NewLimiter ¶ added in v0.1.2
Click to show internal directories.
Click to hide internal directories.