Documentation
¶
Index ¶
- func All[T any, S ~[]T](arr S, fn func(T) bool) bool
- func Comparable[T comparable](v T) T
- func Distinct[T comparable, S ~[]T](arr S) S
- func Done(ctx context.Context) bool
- func Filter[T any, S ~[]T](arr S, fn func(T) bool) S
- func KeyValue(e string) (key string, value string, found bool)
- func KeyValueMulti(e string) (key string, value string, found bool)
- func Map[S any, D any](arr []S, fn func(S) D) []D
- func Must[T any](v T, err error) T
- func Must0[T1 any, T2 any](v1 T1, v2 T2, err error) (T1, T2)
- func Or[T any, S ~[]T](arr S, fn func(T) bool) bool
- func PtrValueOrDefault[T any](v *T) T
- func Reduce[T any, S ~[]T](arr S, fn func(v1, v2 T) T) T
- func Set[T comparable, S ~[]T](arr S) map[T]bool
- func Sum[T cmp.Ordered, S ~[]T](arr S) T
- func Timeout(ctx context.Context, timeout time.Duration) (context.Context, context.CancelFunc)
- func UnquoteString(s string) string
- func Zero[T any]() T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Comparable ¶
func Comparable[T comparable](v T) T
func Distinct ¶
func Distinct[T comparable, S ~[]T](arr S) S
func PtrValueOrDefault ¶
func PtrValueOrDefault[T any](v *T) T
func Set ¶
func Set[T comparable, S ~[]T](arr S) map[T]bool
func UnquoteString ¶
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
common
|
|
|
generic
Package generic To iterate over a list (where l is a *List):
|
Package generic To iterate over a list (where l is a *List): |
|
closeme
Package closeme collects io.Closer and StopCloser resources behind a single Manager and tears them down on demand.
|
Package closeme collects io.Closer and StopCloser resources behind a single Manager and tears them down on demand. |
|
container
Package container provides a hash-table-backed value store that can be attached to a context.Context.
|
Package container provides a hash-table-backed value store that can be attached to a context.Context. |
Click to show internal directories.
Click to hide internal directories.