Documentation ¶
Index ¶
- Variables
- func AddToSet[T comparable](set []T, add T) []T
- func ArrAll[T any](arr []T, fn func(T) bool) bool
- func ArrAllErr[T any](arr []T, fn func(T) (bool, error)) (bool, error)
- func ArrAny[T any](arr []T, fn func(T) bool) bool
- func ArrAnyErr[T any](arr []T, fn func(T) (bool, error)) (bool, error)
- func ArrCastErr[T1 any, T2 any](arr []T1) ([]T2, error)
- func ArrCastPanic[T1 any, T2 any](arr []T1) []T2
- func ArrCastSafe[T1 any, T2 any](arr []T1) []T2
- func ArrCastToAny[T1 any](arr []T1) []any
- func ArrConcat[T any](arr ...[]T) []T
- func ArrCopy[T any](in []T) []T
- func ArrEqualsExact[T comparable](arr1 []T, arr2 []T) bool
- func ArrExcept[T comparable](arr []T, needles ...T) []T
- func ArrFilter[T any](arr []T, filter func(v T) bool) []T
- func ArrFilterMap[T1 any, T2 any](arr []T1, filter func(v T1) bool, conv func(v T1) T2) []T2
- func ArrFirst[T any](arr []T, comp func(v T) bool) (T, bool)
- func ArrFirstIndex[T comparable](arr []T, needle T) int
- func ArrFirstOrNil[T any](arr []T, comp func(v T) bool) *T
- func ArrFlatten[T1 any, T2 any](arr []T1, conv func(v T1) []T2) []T2
- func ArrFlattenDirect[T1 any](arr [][]T1) []T1
- func ArrIdxAll(arr any, fn func(int) bool) bool
- func ArrIdxAllErr(arr any, fn func(int) (bool, error)) (bool, error)
- func ArrIdxAny(arr any, fn func(int) bool) bool
- func ArrIdxAnyErr(arr any, fn func(int) (bool, error)) (bool, error)
- func ArrIdxNone(arr any, fn func(int) bool) bool
- func ArrIdxNoneErr(arr any, fn func(int) (bool, error)) (bool, error)
- func ArrLast[T any](arr []T, comp func(v T) bool) (T, bool)
- func ArrLastIndex[T comparable](arr []T, needle T) int
- func ArrLastOrNil[T any](arr []T, comp func(v T) bool) *T
- func ArrMap[T1 any, T2 any](arr []T1, conv func(v T1) T2) []T2
- func ArrMapErr[T1 any, T2 any](arr []T1, conv func(v T1) (T2, error)) ([]T2, error)
- func ArrMapExt[T1 any, T2 any](arr []T1, conv func(idx int, v T1) T2) []T2
- func ArrNone[T any](arr []T, fn func(T) bool) bool
- func ArrNoneErr[T any](arr []T, fn func(T) (bool, error)) (bool, error)
- func ArrRemove[T comparable](arr []T, needle T) []T
- func ArrSum[T NumberConstraint](arr []T) T
- func ArrToMap[T comparable, V any](a []V, keyfunc func(V) T) map[T]V
- func ArrToSet[T comparable](a []T) map[T]bool
- func ArrUnique[T comparable](array []T) []T
- func ArrayToInterface[T any](t []T) []interface{}
- func BoolCount(arr ...bool) int
- func BytesXOR(a []byte, b []byte) ([]byte, error)
- func Coalesce[T any](v *T, def T) T
- func CoalesceBool(b *bool, def bool) bool
- func CoalesceInt(i *int, def int) int
- func CoalesceInt32(i *int32, def int32) int32
- func CoalesceString(s *string, def string) string
- func CoalesceStringer(s fmt.Stringer, def string) string
- func CoalesceTime(t *time.Time, def time.Time) time.Time
- func Compare[T OrderedConstraint](a, b T) int
- func CompareArr[T OrderedConstraint](arr1 []T, arr2 []T) int
- func CompareInt(a, b int) int
- func CompareInt64(a, b int64) int
- func CompareIntArr(arr1 []int, arr2 []int) bool
- func CompareString(a, b string) int
- func Conditional[T any](v bool, resTrue T, resFalse T) T
- func ConditionalFn00[T any](v bool, resTrue T, resFalse T) T
- func ConditionalFn01[T any](v bool, resTrue T, resFalse func() T) T
- func ConditionalFn10[T any](v bool, resTrue func() T, resFalse T) T
- func ConditionalFn11[T any](v bool, resTrue func() T, resFalse func() T) T
- func ConvertStringerArray[T fmt.Stringer](inarr []T) []string
- func CopyMap[K comparable, V any](a map[K]V) map[K]V
- func DeRefStringer(v fmt.Stringer) *string
- func DecodeBase62(str string) (uint64, error)
- func DegToRad(deg float64) float64
- func EncodeBase62(num uint64) string
- func FileExists(filename string) bool
- func ForceArray[T any](v []T) []T
- func ForceMap[K comparable, V any](v map[K]V) map[K]V
- func FormatBool(v bool, strTrue string, strFalse string) string
- func FormatBytes(b int64) string
- func FormatBytesToSI(b uint64) string
- func GeoDistance(lon1 float64, lat1 float64, lon2 float64, lat2 float64) float64
- func InArray[T comparable](needle T, haystack []T) bool
- func Indent(str string, pad string) string
- func IsNil(i interface{}) bool
- func IsSliceSorted[T any](arr []T, less func(v1, v2 T) bool) bool
- func IsSorted[T OrderedConstraint](arr []T) bool
- func IsSortedBy[TElem any, TSel OrderedConstraint](arr []TElem, selector func(v TElem) TSel)
- func JoinString(arr []string, delimiter string) string
- func MapKeyArr[T comparable, V any](v map[T]V) []T
- func MapMap[TK comparable, TV any, TR any](inmap map[TK]TV, conv func(k TK, v TV) TR) []TR
- func MapMapErr[TK comparable, TV any, TR any](inmap map[TK]TV, conv func(k TK, v TV) (TR, error)) ([]TR, error)
- func MapValueArr[T comparable, V any](v map[T]V) []V
- func MustBracesUUID() string
- func MustHexUUID() string
- func MustParensUUID() string
- func MustRawHexUUID() string
- func MustUpperHexUUID() string
- func NewBracesUUID() (string, error)
- func NewHexUUID() (string, error)
- func NewParensUUID() (string, error)
- func NewRawHexUUID() (string, error)
- func NewUUID() ([16]byte, error)
- func NewUpperHexUUID() (string, error)
- func NumToStringOpt[V IntConstraint](v *V, fallback string) string
- func PatchJson[JV string | []byte](rawjson JV, key string, value any) (JV, error)
- func PatchRemJson[JV string | []byte](rawjson JV, key string) (JV, error)
- func PrettyPrintJson(str string) (string, bool)
- func Ptr[T any](v T) *T
- func PtrEquals[T comparable](v1 *T, v2 *T) bool
- func PtrFloat32(v float32) *float32
- func PtrFloat64(v float64) *float64
- func PtrInt32(v int32) *int32
- func PtrInt64(v int64) *int64
- func RadToDeg(rad float64) float64
- func RandBase62(rlen int) string
- func RandBytes(size int) []byte
- func Range[T IntegerConstraint](start T, end T) []T
- func ReverseArray[T any](v []T)
- func RunPanicSafe(fn func()) (err error)
- func RunPanicSafeR1(fn func() error) (err error)
- func RunPanicSafeR2[T1 any](fn func() (T1, error)) (r1 T1, err error)
- func RunPanicSafeR3[T1 any, T2 any](fn func() (T1, T2, error)) (r1 T1, r2 T2, err error)
- func RunPanicSafeR4[T1 any, T2 any, T3 any](fn func() (T1, T2, T3, error)) (r1 T1, r2 T2, r3 T3, err error)
- func SafeCast[T any](v any, def T) T
- func Sort[T OrderedConstraint](arr []T)
- func SortBy[TElem any, TSel OrderedConstraint](arr []TElem, selector func(v TElem) TSel)
- func SortByStable[TElem any, TSel OrderedConstraint](arr []TElem, selector func(v TElem) TSel)
- func SortSlice[T any](arr []T, less func(v1, v2 T) bool)
- func SortSliceStable[T any](arr []T, less func(v1, v2 T) bool)
- func SortStable[T OrderedConstraint](arr []T)
- func StrLimit(val string, maxlen int, suffix string) string
- func StrPadLeft(str string, pad string, padlen int) string
- func StrPadRight(str string, pad string, padlen int) string
- func StrRepeat(val string, count int) string
- func StrRunePadLeft(str string, pad string, padlen int) string
- func StrRunePadRight(str string, pad string, padlen int) string
- func StrSplit(val string, sep string, allowEmpty bool) []string
- func TryPrettyPrintJson(str string) string
- type A
- type AnyBaseConverter
- func (bc AnyBaseConverter) Decode(src string) ([]byte, error)
- func (bc AnyBaseConverter) DecodeToBigInt(_src string) (*big.Int, error)
- func (bc AnyBaseConverter) DecodeUInt64(str string) (uint64, error)
- func (bc AnyBaseConverter) Encode(src []byte) string
- func (bc AnyBaseConverter) EncodeBigInt(src *big.Int) string
- func (bc AnyBaseConverter) EncodeUInt64(num uint64) string
- func (bc AnyBaseConverter) Rand(rlen int) string
- type B58Encoding
- type ComplexConstraint
- type FloatConstraint
- type H
- type IntConstraint
- type IntegerConstraint
- type MapEntry
- type NumberConstraint
- type OrderedConstraint
- type PanicWrappedErr
- type SignedConstraint
- type UnsignedConstraint
Constants ¶
This section is empty.
Variables ¶
View Source
var Base58BitcoinEncoding = newBase58Encoding("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")
View Source
var Base58DefaultEncoding = newBase58Encoding("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")
View Source
var Base58FlickrEncoding = newBase58Encoding("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ")
View Source
var Base58RippleEncoding = newBase58Encoding("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz")
View Source
var PFalse = Ptr(false)
PFalse := &false
View Source
var PTrue = Ptr(true)
PTrue := &true
Functions ¶
func AddToSet ¶
func AddToSet[T comparable](set []T, add T) []T
func ArrCastErr ¶ added in v0.0.242
func ArrCastPanic ¶ added in v0.0.242
func ArrCastSafe ¶ added in v0.0.242
func ArrCastToAny ¶ added in v0.0.98
func ArrCopy ¶ added in v0.0.242
func ArrCopy[T any](in []T) []T
ArrCopy does a shallow copy of the 'in' array
func ArrEqualsExact ¶
func ArrEqualsExact[T comparable](arr1 []T, arr2 []T) bool
func ArrExcept ¶ added in v0.0.242
func ArrExcept[T comparable](arr []T, needles ...T) []T
func ArrFilterMap ¶ added in v0.0.73
func ArrFirstIndex ¶ added in v0.0.18
func ArrFirstIndex[T comparable](arr []T, needle T) int
func ArrFirstOrNil ¶ added in v0.0.242
func ArrFlatten ¶ added in v0.0.86
func ArrFlattenDirect ¶ added in v0.0.86
func ArrFlattenDirect[T1 any](arr [][]T1) []T1
func ArrIdxAllErr ¶ added in v0.0.33
func ArrIdxAnyErr ¶ added in v0.0.33
func ArrIdxNoneErr ¶ added in v0.0.33
func ArrLastIndex ¶ added in v0.0.18
func ArrLastIndex[T comparable](arr []T, needle T) int
func ArrLastOrNil ¶ added in v0.0.242
func ArrRemove ¶ added in v0.0.242
func ArrRemove[T comparable](arr []T, needle T) []T
func ArrSum ¶ added in v0.0.18
func ArrSum[T NumberConstraint](arr []T) T
func ArrToMap ¶ added in v0.0.74
func ArrToMap[T comparable, V any](a []V, keyfunc func(V) T) map[T]V
func ArrToSet ¶ added in v0.0.242
func ArrToSet[T comparable](a []T) map[T]bool
func ArrUnique ¶
func ArrUnique[T comparable](array []T) []T
func ArrayToInterface ¶ added in v0.0.242
func ArrayToInterface[T any](t []T) []interface{}
func CoalesceBool ¶
func CoalesceInt ¶
func CoalesceInt32 ¶
func CoalesceString ¶
func Compare ¶ added in v0.0.242
func Compare[T OrderedConstraint](a, b T) int
func CompareArr ¶ added in v0.0.12
func CompareArr[T OrderedConstraint](arr1 []T, arr2 []T) int
func CompareInt ¶ added in v0.0.242
func CompareInt64 ¶ added in v0.0.242
func CompareIntArr ¶
func CompareString ¶ added in v0.0.242
func Conditional ¶ added in v0.0.21
func ConditionalFn00 ¶ added in v0.0.56
func ConditionalFn01 ¶ added in v0.0.56
func ConditionalFn10 ¶ added in v0.0.56
func ConditionalFn11 ¶ added in v0.0.56
func ConvertStringerArray ¶
func CopyMap ¶ added in v0.0.242
func CopyMap[K comparable, V any](a map[K]V) map[K]V
func DeRefStringer ¶
func DecodeBase62 ¶ added in v0.0.11
func EncodeBase62 ¶ added in v0.0.11
func FileExists ¶ added in v0.0.5
func ForceArray ¶
func ForceArray[T any](v []T) []T
func ForceMap ¶ added in v0.0.242
func ForceMap[K comparable, V any](v map[K]V) map[K]V
func FormatBytes ¶ added in v0.0.5
func FormatBytesToSI ¶
func GeoDistance ¶ added in v0.0.13
func InArray ¶
func InArray[T comparable](needle T, haystack []T) bool
func IsSliceSorted ¶ added in v0.0.38
func IsSorted ¶ added in v0.0.38
func IsSorted[T OrderedConstraint](arr []T) bool
func IsSortedBy ¶ added in v0.0.64
func IsSortedBy[TElem any, TSel OrderedConstraint](arr []TElem, selector func(v TElem) TSel)
func JoinString ¶ added in v0.0.242
func MapKeyArr ¶ added in v0.0.5
func MapKeyArr[T comparable, V any](v map[T]V) []T
func MapMap ¶ added in v0.0.95
func MapMap[TK comparable, TV any, TR any](inmap map[TK]TV, conv func(k TK, v TV) TR) []TR
func MapMapErr ¶ added in v0.0.95
func MapMapErr[TK comparable, TV any, TR any](inmap map[TK]TV, conv func(k TK, v TV) (TR, error)) ([]TR, error)
func MapValueArr ¶ added in v0.0.242
func MapValueArr[T comparable, V any](v map[T]V) []V
func MustBracesUUID ¶ added in v0.0.242
func MustBracesUUID() string
func MustHexUUID ¶ added in v0.0.242
func MustHexUUID() string
func MustParensUUID ¶ added in v0.0.242
func MustParensUUID() string
func MustRawHexUUID ¶ added in v0.0.242
func MustRawHexUUID() string
func MustUpperHexUUID ¶ added in v0.0.242
func MustUpperHexUUID() string
func NewBracesUUID ¶ added in v0.0.5
func NewHexUUID ¶ added in v0.0.5
func NewParensUUID ¶ added in v0.0.5
func NewRawHexUUID ¶ added in v0.0.5
func NewUpperHexUUID ¶ added in v0.0.5
func NumToStringOpt ¶ added in v0.0.5
func NumToStringOpt[V IntConstraint](v *V, fallback string) string
func PatchRemJson ¶ added in v0.0.5
func PrettyPrintJson ¶ added in v0.0.5
func PtrEquals ¶ added in v0.0.59
func PtrEquals[T comparable](v1 *T, v2 *T) bool
func PtrFloat32 ¶
func PtrFloat64 ¶
func RandBase62 ¶ added in v0.0.5
func Range ¶ added in v0.0.7
func Range[T IntegerConstraint](start T, end T) []T
func ReverseArray ¶
func ReverseArray[T any](v []T)
func RunPanicSafe ¶ added in v0.0.242
func RunPanicSafe(fn func()) (err error)
func RunPanicSafeR1 ¶ added in v0.0.242
func RunPanicSafeR2 ¶ added in v0.0.242
func RunPanicSafeR3 ¶ added in v0.0.242
func RunPanicSafeR4 ¶ added in v0.0.242
func Sort ¶ added in v0.0.38
func Sort[T OrderedConstraint](arr []T)
func SortBy ¶ added in v0.0.64
func SortBy[TElem any, TSel OrderedConstraint](arr []TElem, selector func(v TElem) TSel)
func SortByStable ¶ added in v0.0.64
func SortByStable[TElem any, TSel OrderedConstraint](arr []TElem, selector func(v TElem) TSel)
func SortSliceStable ¶ added in v0.0.38
func SortStable ¶ added in v0.0.38
func SortStable[T OrderedConstraint](arr []T)
func StrRunePadLeft ¶ added in v0.0.5
func StrRunePadRight ¶ added in v0.0.5
func TryPrettyPrintJson ¶ added in v0.0.5
Types ¶
type AnyBaseConverter ¶ added in v0.0.295
type AnyBaseConverter struct {
// contains filtered or unexported fields
}
func NewAnyBaseConverter ¶ added in v0.0.295
func NewAnyBaseConverter(cs string) AnyBaseConverter
func (AnyBaseConverter) Decode ¶ added in v0.0.295
func (bc AnyBaseConverter) Decode(src string) ([]byte, error)
func (AnyBaseConverter) DecodeToBigInt ¶ added in v0.0.295
func (bc AnyBaseConverter) DecodeToBigInt(_src string) (*big.Int, error)
func (AnyBaseConverter) DecodeUInt64 ¶ added in v0.0.295
func (bc AnyBaseConverter) DecodeUInt64(str string) (uint64, error)
func (AnyBaseConverter) Encode ¶ added in v0.0.295
func (bc AnyBaseConverter) Encode(src []byte) string
func (AnyBaseConverter) EncodeBigInt ¶ added in v0.0.295
func (bc AnyBaseConverter) EncodeBigInt(src *big.Int) string
func (AnyBaseConverter) EncodeUInt64 ¶ added in v0.0.295
func (bc AnyBaseConverter) EncodeUInt64(num uint64) string
func (AnyBaseConverter) Rand ¶ added in v0.0.295
func (bc AnyBaseConverter) Rand(rlen int) string
type B58Encoding ¶ added in v0.0.92
type B58Encoding struct {
// contains filtered or unexported fields
}
func (*B58Encoding) Decode ¶ added in v0.0.92
func (enc *B58Encoding) Decode(src []byte) ([]byte, error)
func (*B58Encoding) DecodeString ¶ added in v0.0.92
func (enc *B58Encoding) DecodeString(src string) (string, error)
func (*B58Encoding) Encode ¶ added in v0.0.92
func (enc *B58Encoding) Encode(src []byte) ([]byte, error)
func (*B58Encoding) EncodeString ¶ added in v0.0.92
func (enc *B58Encoding) EncodeString(src string) (string, error)
type ComplexConstraint ¶ added in v0.0.6
type ComplexConstraint interface { ~complex64 | ~complex128 }
type FloatConstraint ¶ added in v0.0.6
type IntConstraint ¶ added in v0.0.5
type IntegerConstraint ¶ added in v0.0.6
type IntegerConstraint interface { SignedConstraint | UnsignedConstraint }
type MapEntry ¶ added in v0.0.242
type MapEntry[T comparable, V any] struct { Key T Value V }
func MapToArr ¶ added in v0.0.242
func MapToArr[T comparable, V any](v map[T]V) []MapEntry[T, V]
type NumberConstraint ¶ added in v0.0.6
type NumberConstraint interface { IntegerConstraint | FloatConstraint }
type OrderedConstraint ¶ added in v0.0.6
type OrderedConstraint interface { IntegerConstraint | FloatConstraint | ~string }
type PanicWrappedErr ¶ added in v0.0.242
type PanicWrappedErr struct { Stack string // contains filtered or unexported fields }
func (PanicWrappedErr) Error ¶ added in v0.0.242
func (p PanicWrappedErr) Error() string
func (PanicWrappedErr) ReoveredObj ¶ added in v0.0.242
func (p PanicWrappedErr) ReoveredObj() any
type SignedConstraint ¶ added in v0.0.6
Click to show internal directories.
Click to hide internal directories.