Documentation ¶
Index ¶
- func AddToSet[T comparable](set []T, add T) []T
- func ArrAll(arr interface{}, fn func(int) bool) bool
- func ArrAllErr(arr interface{}, fn func(int) (bool, error)) (bool, error)
- func ArrAny(arr interface{}, fn func(int) bool) bool
- func ArrAnyErr(arr interface{}, fn func(int) (bool, error)) (bool, error)
- func ArrEqualsExact[T comparable](arr1 []T, arr2 []T) bool
- func ArrFirst[T comparable](arr []T, comp func(v T) bool) (T, bool)
- func ArrFirstIndex[T comparable](arr []T, needle T) int
- func ArrLast[T comparable](arr []T, comp func(v T) bool) (T, bool)
- func ArrLastIndex[T comparable](arr []T, needle T) int
- func ArrMap[T1 any, T2 any](arr []T1, conv func(v T1) T2) []T2
- func ArrNone(arr interface{}, fn func(int) bool) bool
- func ArrNoneErr(arr interface{}, fn func(int) (bool, error)) (bool, error)
- func ArrSum[T NumberConstraint](arr []T) T
- func ArrUnique[T comparable](array []T) []T
- 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 CompareArr[T OrderedConstraint](arr1 []T, arr2 []T) bool
- func CompareIntArr(arr1 []int, arr2 []int) bool
- func Conditional[T any](v bool, resTrue T, resFalse T) T
- func ConvertStringerArray[T fmt.Stringer](inarr []T) []string
- 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 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 MapKeyArr[T comparable, V any](v map[T]V) []T
- 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 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 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 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 ComplexConstraint
- type FloatConstraint
- type H
- type IntConstraint
- type IntegerConstraint
- type NumberConstraint
- type OrderedConstraint
- type SignedConstraint
- type UnsignedConstraint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddToSet ¶
func AddToSet[T comparable](set []T, add T) []T
func ArrEqualsExact ¶
func ArrEqualsExact[T comparable](arr1 []T, arr2 []T) bool
func ArrFirst ¶ added in v0.0.8
func ArrFirst[T comparable](arr []T, comp func(v T) bool) (T, bool)
func ArrFirstIndex ¶ added in v0.0.18
func ArrFirstIndex[T comparable](arr []T, needle T) int
func ArrLast ¶ added in v0.0.8
func ArrLast[T comparable](arr []T, comp func(v T) bool) (T, bool)
func ArrLastIndex ¶ added in v0.0.18
func ArrLastIndex[T comparable](arr []T, needle T) int
func ArrSum ¶ added in v0.0.18
func ArrSum[T NumberConstraint](arr []T) T
func ArrUnique ¶
func ArrUnique[T comparable](array []T) []T
func CoalesceBool ¶
func CoalesceInt ¶
func CoalesceInt32 ¶
func CoalesceString ¶
func CompareArr ¶ added in v0.0.12
func CompareArr[T OrderedConstraint](arr1 []T, arr2 []T) bool
func CompareIntArr ¶
func Conditional ¶ added in v0.0.21
func ConvertStringerArray ¶
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 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 MapKeyArr ¶ added in v0.0.5
func MapKeyArr[T comparable, V any](v map[T]V) []T
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 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 StrRunePadLeft ¶ added in v0.0.5
func StrRunePadRight ¶ added in v0.0.5
func TryPrettyPrintJson ¶ added in v0.0.5
Types ¶
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 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 SignedConstraint ¶ added in v0.0.6
Click to show internal directories.
Click to hide internal directories.