Documentation ¶
Index ¶
- func Wrap(f func(), opts ...Option) func()
- func Wrap00(f func(), opts ...Option) func()
- func Wrap01[R1 any](f func() R1, opts ...Option) func() R1
- func Wrap02[R1, R2 any](f func() (R1, R2), opts ...Option) func() (R1, R2)
- func Wrap10[T1 any](f func(T1), opts ...Option) func(T1)
- func Wrap11[T1, R1 any](f func(T1) R1, opts ...Option) func(T1) R1
- func Wrap12[T1, R1, R2 any](f func(T1) (R1, R2), opts ...Option) func(T1) (R1, R2)
- func Wrap20[T1, T2 any](f func(T1, T2), opts ...Option) func(T1, T2)
- func Wrap21[T1, T2, R1 any](f func(T1, T2) R1, opts ...Option) func(T1, T2) R1
- func Wrap22[T1, T2, R1, R2 any](f func(T1, T2) (R1, R2), opts ...Option) func(T1, T2) (R1, R2)
- func Wrap30[T1, T2, T3 any](f func(T1, T2, T3), opts ...Option) func(T1, T2, T3)
- func Wrap31[T1, T2, T3, R1 any](f func(T1, T2, T3) R1, opts ...Option) func(T1, T2, T3) R1
- func Wrap32[T1, T2, T3, R1, R2 any](f func(T1, T2, T3) (R1, R2), opts ...Option) func(T1, T2, T3) (R1, R2)
- func Wrap40[T1, T2, T3, T4 any](f func(T1, T2, T3, T4), opts ...Option) func(T1, T2, T3, T4)
- func Wrap41[T1, T2, T3, T4, R1 any](f func(T1, T2, T3, T4) R1, opts ...Option) func(T1, T2, T3, T4) R1
- func Wrap42[T1, T2, T3, T4, R1, R2 any](f func(T1, T2, T3, T4) (R1, R2), opts ...Option) func(T1, T2, T3, T4) (R1, R2)
- func WrapCE(f func(context.Context) error, opts ...Option) func(context.Context) error
- func WrapCE11(f func(context.Context) error, opts ...Option) func(context.Context) error
- func WrapCE12[R1 any](f func(context.Context) (R1, error), opts ...Option) func(context.Context) (R1, error)
- func WrapCE21[T2 any](f func(context.Context, T2) error, opts ...Option) func(context.Context, T2) error
- func WrapCE22[T2, R1 any](f func(context.Context, T2) (R1, error), opts ...Option) func(context.Context, T2) (R1, error)
- func WrapCE31[T2, T3 any](f func(context.Context, T2, T3) error, opts ...Option) func(context.Context, T2, T3) error
- func WrapCE32[T2, T3, R1 any](f func(context.Context, T2, T3) (R1, error), opts ...Option) func(context.Context, T2, T3) (R1, error)
- func WrapCE41[T2, T3, T4 any](f func(context.Context, T2, T3, T4) error, opts ...Option) func(context.Context, T2, T3, T4) error
- func WrapCE42[T2, T3, T4, R1 any](f func(context.Context, T2, T3, T4) (R1, error), opts ...Option) func(context.Context, T2, T3, T4) (R1, error)
- func WrapE(f func() error, opts ...Option) func() error
- func WrapE01(f func() error, opts ...Option) func() error
- func WrapE02[R1 any](f func() (R1, error), opts ...Option) func() (R1, error)
- func WrapE11[T1 any](f func(T1) error, opts ...Option) func(T1) error
- func WrapE12[T1, R1 any](f func(T1) (R1, error), opts ...Option) func(T1) (R1, error)
- func WrapE21[T1, T2 any](f func(T1, T2) error, opts ...Option) func(T1, T2) error
- func WrapE22[T1, T2, R1 any](f func(T1, T2) (R1, error), opts ...Option) func(T1, T2) (R1, error)
- func WrapE31[T1, T2, T3 any](f func(T1, T2, T3) error, opts ...Option) func(T1, T2, T3) error
- func WrapE32[T1, T2, T3, R1 any](f func(T1, T2, T3) (R1, error), opts ...Option) func(T1, T2, T3) (R1, error)
- func WrapE41[T1, T2, T3, T4 any](f func(T1, T2, T3, T4) error, opts ...Option) func(T1, T2, T3, T4) error
- func WrapE42[T1, T2, T3, T4, R1 any](f func(T1, T2, T3, T4) (R1, error), opts ...Option) func(T1, T2, T3, T4) (R1, error)
- type Chunks
- type CtxErrFunc
- type Middleware
- type Option
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Wrap00 ¶
func Wrap00( f func(), opts ...Option, ) func()
Wrap00 wraps a function with 0 inputs and 0 outputs.
func Wrap32 ¶
func Wrap32[T1, T2, T3, R1, R2 any]( f func(T1, T2, T3) (R1, R2), opts ...Option, ) func(T1, T2, T3) (R1, R2)
Wrap32 wraps a function with 3 inputs and 2 outputs.
func Wrap41 ¶
func Wrap41[T1, T2, T3, T4, R1 any]( f func(T1, T2, T3, T4) R1, opts ...Option, ) func(T1, T2, T3, T4) R1
Wrap41 wraps a function with 4 inputs and 1 outputs.
func Wrap42 ¶
func Wrap42[T1, T2, T3, T4, R1, R2 any]( f func(T1, T2, T3, T4) (R1, R2), opts ...Option, ) func(T1, T2, T3, T4) (R1, R2)
Wrap42 wraps a function with 4 inputs and 2 outputs.
func WrapCE12 ¶
func WrapCE12[R1 any]( f func(context.Context) (R1, error), opts ...Option, ) func(context.Context) (R1, error)
WrapCE12 wraps a function with 1 inputs and 2 outputs.
func WrapCE21 ¶
func WrapCE21[T2 any]( f func(context.Context, T2) error, opts ...Option, ) func(context.Context, T2) error
WrapCE21 wraps a function with 2 inputs and 1 outputs.
func WrapCE22 ¶
func WrapCE22[T2, R1 any]( f func(context.Context, T2) (R1, error), opts ...Option, ) func(context.Context, T2) (R1, error)
WrapCE22 wraps a function with 2 inputs and 2 outputs.
func WrapCE31 ¶
func WrapCE31[T2, T3 any]( f func(context.Context, T2, T3) error, opts ...Option, ) func(context.Context, T2, T3) error
WrapCE31 wraps a function with 3 inputs and 1 outputs.
func WrapCE32 ¶
func WrapCE32[T2, T3, R1 any]( f func(context.Context, T2, T3) (R1, error), opts ...Option, ) func(context.Context, T2, T3) (R1, error)
WrapCE32 wraps a function with 3 inputs and 2 outputs.
func WrapCE41 ¶
func WrapCE41[T2, T3, T4 any]( f func(context.Context, T2, T3, T4) error, opts ...Option, ) func(context.Context, T2, T3, T4) error
WrapCE41 wraps a function with 4 inputs and 1 outputs.
func WrapCE42 ¶
func WrapCE42[T2, T3, T4, R1 any]( f func(context.Context, T2, T3, T4) (R1, error), opts ...Option, ) func(context.Context, T2, T3, T4) (R1, error)
WrapCE42 wraps a function with 4 inputs and 2 outputs.
func WrapE22 ¶
func WrapE22[T1, T2, R1 any]( f func(T1, T2) (R1, error), opts ...Option, ) func(T1, T2) (R1, error)
WrapE22 wraps a function with 2 inputs and 2 outputs.
func WrapE32 ¶
func WrapE32[T1, T2, T3, R1 any]( f func(T1, T2, T3) (R1, error), opts ...Option, ) func(T1, T2, T3) (R1, error)
WrapE32 wraps a function with 3 inputs and 2 outputs.
Types ¶
type Chunks ¶
type Chunks struct {
// contains filtered or unexported fields
}
func NewChunks ¶
NewChunks returns a Chunks instance that helps with splitting a slice into chunks.
Example ¶
package main import ( "fmt" "audit/minos/internal/run" ) func main() { values := make([]int, 100) for i := range values { values[i] = i } for c := run.NewChunks(len(values), 10); c.Next(); { chunk := values[c.Start():c.End()] fmt.Println(len(chunk), chunk) } }
Output:
func (*Chunks) End ¶
End returns the end of the current chunk. End() is meant to be used as the second parameter in a slice expression.
type CtxErrFunc ¶
type Middleware ¶
type Middleware func(ctx context.Context, f CtxErrFunc) error
type Option ¶
type Option func(r *runner)
func WithConstantBackoff ¶
func WithExponentialBackOff ¶
func WithMaxRetries ¶
func WithMiddleware ¶
func WithMiddleware(m Middleware) Option
func WithRecover ¶
func WithRecover() Option
func WithSingleflight ¶
func WithSingleflight() Option