Documentation ¶
Index ¶
- func Do(tasks ...Task) (err error)
- func DoContext(ctx context.Context, tasks ...ContextTask) (err error)
- func Extract[T any](ctx context.Context) (out T, ok bool)
- func Guard(err *error)
- func IgnoreEOF(err *error)
- func Inject[T any](ctx context.Context, v T) context.Context
- func InjectKey[T any](v *T) any
- func MapKeys[T comparable, U any](m map[T]U) []T
- func MapVals[T comparable, U any](m map[T]U) []U
- func Must[T any](v T, err error) T
- func Must0(err error)
- func Must2[T1 any, T2 any](v1 T1, v2 T2, err error) (T1, T2)
- func Must3[T1 any, T2 any, T3 any](v1 T1, v2 T2, v3 T3, err error) (T1, T2, T3)
- func Must4[T1 any, T2 any, T3 any, T4 any](v1 T1, v2 T2, v3 T3, v4 T4, err error) (T1, T2, T3, T4)
- func MustContext(ctx context.Context)
- func MustDo(tasks ...Task)
- func MustDoContext(ctx context.Context, tasks ...ContextTask)
- func Ptr[T any](v T) *T
- func Repeat[T any](count int, v T) []T
- func SliceToMap[T any, U comparable](s []T, fn func(v T) U) map[U]T
- type ContextTask
- type ContextTaskFunc
- type ErrorGroup
- type Errors
- type Executor01
- type Executor02
- type Executor10
- type Executor11
- type Executor12
- type Executor21
- type Executor22
- type Func01
- type Func02
- type Func10
- type Func11
- type Func12
- type Func21
- type Func22
- type M
- type Task
- type TaskFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MapKeys ¶
func MapKeys[T comparable, U any](m map[T]U) []T
func MapVals ¶
func MapVals[T comparable, U any](m map[T]U) []U
func MustContext ¶
func MustDoContext ¶
func MustDoContext(ctx context.Context, tasks ...ContextTask)
func SliceToMap ¶
func SliceToMap[T any, U comparable](s []T, fn func(v T) U) map[U]T
Types ¶
type ContextTask ¶
type ContextTask = Executor11[context.Context, error]
type ErrorGroup ¶
type ErrorGroup struct {
// contains filtered or unexported fields
}
func NewErrorGroup ¶
func NewErrorGroup() *ErrorGroup
func (*ErrorGroup) Add ¶
func (eg *ErrorGroup) Add(err error)
func (*ErrorGroup) Unwrap ¶
func (eg *ErrorGroup) Unwrap() error
type Executor01 ¶
type Executor01[O1 any] interface { Do() (o1 O1) }
type Executor02 ¶
type Executor10 ¶
type Executor10[I1 any] interface { Do(i1 I1) }
type Executor11 ¶
type Executor12 ¶
type Executor21 ¶
type Executor22 ¶
type Task ¶
type Task = Executor01[error]
Source Files ¶
Click to show internal directories.
Click to hide internal directories.