Documentation
¶
Index ¶
- Constants
- Variables
- func All[T any](array []T, block func(it T) bool) bool
- func AllIndexed[T any](array []T, block func(index int, it T) bool) bool
- func Any[T any](array []T, block func(it T) bool) bool
- func AnyError(errs ...error) errordeprecated
- func AnyIndexed[T any](array []T, block func(index int, it T) bool) bool
- func Cast[T any](obj any) (T, bool)
- func ClearArray[T ~[]E, E any](t T)deprecated
- func ClearMap[T ~map[K]V, K comparable, V any](t T)deprecated
- func Close(closers ...any) error
- func Closer(closer func() error) io.Closer
- func Contains[T comparable](arr []T, target T) bool
- func DefaultValue[T any]() T
- func Done(ctx context.Context) bool
- func Dup[T any](obj T) T
- func Equal[S ~[]E, E comparable](s1, s2 S) bool
- func Error(_ any, err error) error
- func Filter[T any](arr []T, block func(it T) bool) []T
- func FilterIndexed[T any](arr []T, block func(index int, it T) bool) []T
- func FilterIsInstance[T any, N any](arr []T, block func(it T) (N, bool)) []N
- func FilterNotDefault[T comparable](arr []T) []T
- func FilterNotNil[T any](arr []T) []T
- func Find[T any](arr []T, block func(it T) bool) T
- func FindIndexed[T any](arr []T, block func(index int, it T) bool) T
- func FlatMap[T any, N any](arr []T, block func(it T) []N) []N
- func FlatMapIndexed[T any, N any](arr []T, block func(index int, it T) []N) []N
- func Index[T any](arr []T, block func(it T) bool) int
- func IndexIndexed[T any](arr []T, block func(index int, it T) bool) int
- func IsEmpty[T comparable](obj T) bool
- func KeepAlive(obj any)
- func Map[T any, N any](arr []T, block func(it T) N) []N
- func MapIndexed[T any, N any](arr []T, block func(index int, it T) N) []N
- func Max[T cmp.Ordered](x, y T) Tdeprecated
- func MaxBy[T any, C cmp.Ordered](arr []T, block func(it T) C) T
- func Min[T cmp.Ordered](x, y T) Tdeprecated
- func MinBy[T any, C cmp.Ordered](arr []T, block func(it T) C) T
- func Must(errs ...error)
- func Must1[T any](result T, err error) T
- func Must2[T any, T2 any](result T, result2 T2, err error) (T, T2)
- func MustCast[T any](obj any) T
- func OnceFunc(f func()) func()deprecated
- func OnceValue[T any](f func() T) func() Tdeprecated
- func OnceValues[T1, T2 any](f func() (T1, T2)) func() (T1, T2)deprecated
- func Ptr[T any](obj T) *T
- func PtrOrNil[T any](ptr *T) any
- func PtrValueOrDefault[T any](ptr *T) T
- func Reverse[T any](arr []T) []T
- func ReverseMap[K comparable, V comparable](m map[K]V) map[V]K
- func SelectContext(contextList []context.Context) (int, error)deprecated
- func SortBy[T any, C cmp.Ordered](arr []T, block func(it T) C)
- func SubstringAfter(s string, substr string) string
- func SubstringAfterLast(s string, substr string) string
- func SubstringBefore(s string, substr string) string
- func SubstringBeforeLast(s string, substr string) string
- func SubstringBetween(s string, after string, before string) string
- func Top(obj any) any
- func Uniq[T comparable](arr []T) []T
- func UniqBy[T any, C comparable](arr []T, block func(it T) C) []T
- type ContextCancelCauseFuncdeprecated
- type TypedValue
- type WithUpstream
Constants ¶
View Source
const LowMemory = false
Variables ¶
View Source
var ( // Deprecated: use [context.WithCancelCause] directly. ContextWithCancelCause = context.WithCancelCause // Deprecated: use [context.Cause] directly. ContextCause = context.Cause )
View Source
var NativeEndian = binary.NativeEndian
Deprecated: use binary.NativeEndian directly.
Functions ¶
func ClearArray
deprecated
added in
v0.3.0
func ClearArray[T ~[]E, E any](t T)
Deprecated: use the [clear] builtin directly.
func ClearMap
deprecated
added in
v0.3.0
func ClearMap[T ~map[K]V, K comparable, V any](t T)
Deprecated: use the [clear] builtin directly.
func Contains ¶
func Contains[T comparable](arr []T, target T) bool
func DefaultValue ¶
func DefaultValue[T any]() T
func Equal ¶ added in v0.6.0
func Equal[S ~[]E, E comparable](s1, s2 S) bool
func FilterIndexed ¶
func FilterIsInstance ¶
func FilterNotDefault ¶
func FilterNotDefault[T comparable](arr []T) []T
func FilterNotNil ¶
func FilterNotNil[T any](arr []T) []T
func FindIndexed ¶ added in v0.2.5
func FlatMapIndexed ¶
func IndexIndexed ¶ added in v0.2.5
func IsEmpty ¶
func IsEmpty[T comparable](obj T) bool
func MapIndexed ¶
func OnceFunc
deprecated
added in
v0.5.0
func OnceFunc(f func()) func()
Deprecated: use sync.OnceFunc directly.
func OnceValue
deprecated
added in
v0.5.0
func OnceValue[T any](f func() T) func() T
Deprecated: use sync.OnceValue directly.
func OnceValues
deprecated
added in
v0.5.0
func OnceValues[T1, T2 any](f func() (T1, T2)) func() (T1, T2)
Deprecated: use sync.OnceValues directly.
func PtrValueOrDefault ¶
func PtrValueOrDefault[T any](ptr *T) T
func ReverseMap ¶ added in v0.6.0
func ReverseMap[K comparable, V comparable](m map[K]V) map[V]K
func SelectContext
deprecated
added in
v0.2.3
func SubstringAfter ¶
func SubstringAfterLast ¶
func SubstringBefore ¶
func SubstringBeforeLast ¶
func Uniq ¶
func Uniq[T comparable](arr []T) []T
func UniqBy ¶
func UniqBy[T any, C comparable](arr []T, block func(it T) C) []T
Types ¶
type ContextCancelCauseFunc
deprecated
added in
v0.2.3
type ContextCancelCauseFunc = context.CancelCauseFunc
Deprecated: use context.CancelCauseFunc directly.
type TypedValue ¶ added in v0.7.6
func (*TypedValue[T]) CompareAndSwap ¶ added in v0.7.6
func (t *TypedValue[T]) CompareAndSwap(old, new T) bool
func (*TypedValue[T]) Load ¶ added in v0.7.6
func (t *TypedValue[T]) Load() T
func (*TypedValue[T]) Store ¶ added in v0.7.6
func (t *TypedValue[T]) Store(value T)
func (*TypedValue[T]) Swap ¶ added in v0.7.6
func (t *TypedValue[T]) Swap(new T) T
type WithUpstream ¶
type WithUpstream interface {
Upstream() any
}
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package binary implements simple translation between numbers and byte sequences and encoding and decoding of varints.
|
Package binary implements simple translation between numbers and byte sequences and encoding and decoding of varints. |
|
internal/contextjson
Package json implements encoding and decoding of JSON as defined in RFC 7159.
|
Package json implements encoding and decoding of JSON as defined in RFC 7159. |
|
Package ntp provides an implementation of a Simple NTP (SNTP) client capable of querying the current time from a remote NTP server.
|
Package ntp provides an implementation of a Simple NTP (SNTP) client capable of querying the current time from a remote NTP server. |
|
x
|
|
|
constraints
Package constraints defines a set of useful constraints to be used with type parameters.
|
Package constraints defines a set of useful constraints to be used with type parameters. |
|
list
Package list implements a doubly linked list.
|
Package list implements a doubly linked list. |
Click to show internal directories.
Click to hide internal directories.