Documentation ¶
Index ¶
- func AppendIfNotContains[T comparable](s []T, v T) []T
- func ApplyToAll[T any](s []T, f func(v T) T)
- func Block(ctx context.Context)
- func CleanBase(dir string) string
- func Contains[T comparable](s []T, v T) bool
- func ContainsAll[T comparable](s []T, v []T) bool
- func ContainsAny[T comparable](s []T, v []T) bool
- func Diff[T comparable](before, after []T) (added, removed []T)
- func HasDuplicates[T constraints.Ordered](v []T) bool
- func IndexOf[T comparable](s []T, v T) int
- func IsErrCode(err error, code int) bool
- func Opt[T any](v []T, def ...T) T
- func QueryInt(ctx *routing.Context, name string, def int) (int, error)
- func Remove[T comparable](s []T, v T) []T
- func SplitAndClean(v string, sep string) []string
- func SplitIfNotEmpty(v string, sep string) []string
- func StartsWithAny(v string, prefixes []string) (bool, string)
- func WrapReadCloser(rc io.ReadCloser, afterClose func(error) error) readCloserWrapper
- type Waiters
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendIfNotContains ¶
func AppendIfNotContains[T comparable](s []T, v T) []T
func ApplyToAll ¶
func ApplyToAll[T any](s []T, f func(v T) T)
func Contains ¶
func Contains[T comparable](s []T, v T) bool
func ContainsAll ¶
func ContainsAll[T comparable](s []T, v []T) bool
func ContainsAny ¶
func ContainsAny[T comparable](s []T, v []T) bool
func Diff ¶
func Diff[T comparable](before, after []T) (added, removed []T)
func HasDuplicates ¶
func HasDuplicates[T constraints.Ordered](v []T) bool
func IndexOf ¶
func IndexOf[T comparable](s []T, v T) int
func Remove ¶
func Remove[T comparable](s []T, v T) []T
func SplitAndClean ¶
func SplitIfNotEmpty ¶
func WrapReadCloser ¶ added in v1.4.0
func WrapReadCloser(rc io.ReadCloser, afterClose func(error) error) readCloserWrapper
Types ¶
type Waiters ¶
type Waiters[TKey any] struct { // contains filtered or unexported fields }
func (*Waiters[TKey]) BroadcastAndRemove ¶
func (*Waiters[TKey]) CreateAndWait ¶
func (t *Waiters[TKey]) CreateAndWait(key TKey)
Click to show internal directories.
Click to hide internal directories.