Documentation ¶
Index ¶
- func Abs[T constraints.Integer](n T) T
- func AppendUnique[T comparable](slice []T, elems ...T) []T
- func AssertMustError(err error, target ...error)
- func AssertNoError(err error, prefix ...string)
- func AssertNotNil[T comparable](el T)
- func Assertf(cond bool, format string, args ...any)
- func CallWithTimeout(fun func(), timeout time.Duration) bool
- func CatchPanicOrError(f func() error, includeStack ...bool) error
- func ClearSlice[T any](slice []T) []T
- func CloneExactCap(data []byte) []byte
- func DoUntil(bodyFun func(), cond func() bool)
- func ED25519PrivateKeyFromHexString(str string) (ed25519.PrivateKey, error)
- func EqualSlices[T comparable](s1, s2 []T) bool
- func ErrorConditionf(cond bool, format string, args ...any) error
- func EvalLazyArgs(args ...any) []any
- func Find[T comparable](lst []T, el T) int
- func FindFirstKeyInMap[K comparable, V any](m map[K]V, cond ...func(k K) bool) (K, bool)
- func ForEachUniquePair[T any](sl []T, fun func(a1, a2 T) bool)
- func GoTh[T Integer](v T) string
- func GoThousandsLazy[T Integer](v T) func() string
- func IsNil(p interface{}) bool
- func KeysFiltered[K comparable, V any](m map[K]V, filter func(k K) bool) []K
- func KeysSorted[K comparable, V any](m map[K]V, less func(k1, k2 K) bool) []K
- func List[T any](elems ...T) []T
- func MakeErrFuncForPrefix(prefix string) func(err interface{}, args ...interface{}) error
- func MakeRange[T constraints.Integer](from, toIncl T) []T
- func Maximum[T any](lst []T, less func(el1, el2 T) bool) T
- func Minimum[T any](lst []T, less func(el1, el2 T) bool) T
- func MustLastElement[T any](sl []T) T
- func MustPrivateKeyFromHexString(k string) ed25519.PrivateKey
- func MustTakeFirstKeyInMap[K comparable, V any](m map[K]V) K
- func Panicf(format string, args ...any)
- func Percent(n, d int) float32
- func PercentString(n, d int) string
- func PrivateKeyFromHexString(k string) (ed25519.PrivateKey, error)
- func PurgeSlice[T any](slice []T, filter func(el T) bool, maxElems ...int) []T
- func RangeReverse[T any](slice []T, fun func(i int, elem T) bool)
- func Ref[T any](v T) *T
- func RequireErrorWith(t *testing.T, err error, fragments ...string)
- func RequirePanicOrErrorWith(t *testing.T, f func() error, fragments ...string)
- func RunWrappedRoutine(name string, fun func(), onPanic func(err error) bool)
- func SortKeys[K comparable, V any](m map[K]V, less func(k1, k2 K) bool) []K
- func ValuesFiltered[K comparable, V any](m map[K]V, filter func(v V) bool) []V
- type Integer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Abs ¶
func Abs[T constraints.Integer](n T) T
func AppendUnique ¶
func AppendUnique[T comparable](slice []T, elems ...T) []T
func AssertMustError ¶
func AssertNoError ¶
func AssertNotNil ¶
func AssertNotNil[T comparable](el T)
func CallWithTimeout ¶
func CatchPanicOrError ¶
func ClearSlice ¶
func ClearSlice[T any](slice []T) []T
func CloneExactCap ¶
func ED25519PrivateKeyFromHexString ¶
func ED25519PrivateKeyFromHexString(str string) (ed25519.PrivateKey, error)
func EqualSlices ¶
func EqualSlices[T comparable](s1, s2 []T) bool
func EvalLazyArgs ¶
func Find ¶
func Find[T comparable](lst []T, el T) int
func FindFirstKeyInMap ¶
func FindFirstKeyInMap[K comparable, V any](m map[K]V, cond ...func(k K) bool) (K, bool)
func ForEachUniquePair ¶
func GoThousandsLazy ¶
func KeysFiltered ¶
func KeysFiltered[K comparable, V any](m map[K]V, filter func(k K) bool) []K
func KeysSorted ¶
func KeysSorted[K comparable, V any](m map[K]V, less func(k1, k2 K) bool) []K
func MakeErrFuncForPrefix ¶
func MakeRange ¶
func MakeRange[T constraints.Integer](from, toIncl T) []T
func MustLastElement ¶
func MustLastElement[T any](sl []T) T
func MustPrivateKeyFromHexString ¶
func MustPrivateKeyFromHexString(k string) ed25519.PrivateKey
func MustTakeFirstKeyInMap ¶
func MustTakeFirstKeyInMap[K comparable, V any](m map[K]V) K
func PercentString ¶
func PrivateKeyFromHexString ¶
func PrivateKeyFromHexString(k string) (ed25519.PrivateKey, error)
func PurgeSlice ¶
PurgeSlice filters elements on the same underlying array
func RangeReverse ¶
func RequirePanicOrErrorWith ¶
func RunWrappedRoutine ¶
func SortKeys ¶
func SortKeys[K comparable, V any](m map[K]V, less func(k1, k2 K) bool) []K
func ValuesFiltered ¶
func ValuesFiltered[K comparable, V any](m map[K]V, filter func(v V) bool) []V
Types ¶
Directories ¶
Path | Synopsis |
---|---|
Package lazybytes is a way to treat byte data as serialized arrays or, recursively, as trees of byte slices It is used for fast, safe and uniform serialization/deserialization in 'lazy' way: the bytes are only deserialized when there's a need to access element of the array or a tree The read-only lazy array and tree are thread safe.
|
Package lazybytes is a way to treat byte data as serialized arrays or, recursively, as trees of byte slices It is used for fast, safe and uniform serialization/deserialization in 'lazy' way: the bytes are only deserialized when there's a need to access element of the array or a tree The read-only lazy array and tree are thread safe. |
Click to show internal directories.
Click to hide internal directories.