Documentation
¶
Index ¶
- func CheckHash(input, hash string) error
- func Contains[T comparable](slice []T, element T) bool
- func CopyFile(src string, dst string) error
- func Env(name string, defaultValues ...string) string
- func EscapeQuery(query string) string
- func Filter[T any](slice []T, predicate func(T) bool) []T
- func GenerateHash(input string) (string, error)
- func GetMapKeys[K comparable, V any](m map[K]V) []K
- func GetMapValues[K comparable, V any](m map[K]V) []V
- func If[T any](condition bool, ifTrue T, ifFalse T) T
- func IfFn[T any](condition bool, ifTrue func() T, ifFalse func() T) T
- func IsFileExists(filePath string) bool
- func IsNumber(value any) bool
- func IsValidBool(v any) bool
- func IsValidFloat(v any) bool
- func IsValidInt(v any) bool
- func IsValidString(v any) bool
- func IsValidTime(v any) bool
- func IsValidUInt(v any) bool
- func Map[T any, R any](slice []T, mapper func(T) R) []R
- func MkDirs(dirs ...string) error
- func Must[T any](value T, err error) T
- func Pick(obj any, path string, defaultValues ...any) any
- func RandomString(length int) string
- func SecureRandomBytes(length int) []byte
- func SliceEqual[T comparable](slice1 []T, slice2 []T) bool
- func SliceInsertBeforeElement[T comparable](slice []T, newElement T, checkIndexFn func(element T) bool) []T
- func WriteFile(filePath string, content string) error
- type HashConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains[T comparable](slice []T, element T) bool
func EscapeQuery ¶
EscapeQuery escapes the query string to be used in a regular expression. copied from ent test
func GenerateHash ¶
func GetMapKeys ¶
func GetMapKeys[K comparable, V any](m map[K]V) []K
func GetMapValues ¶
func GetMapValues[K comparable, V any](m map[K]V) []V
func IsFileExists ¶
IsFileExists checks if the given file path exists.
func IsValidBool ¶
IsValidBool check if the given value is a valid boolean.
func IsValidFloat ¶
IsValidFloat check if the given value is a valid float.
func IsValidInt ¶
IsValidInt check if the given value is a valid integer.
func IsValidString ¶
IsValidString check if the given value is a valid string.
func IsValidTime ¶
IsValidTime check if the given value is a valid time.
func IsValidUInt ¶
IsValidUInt check if the given value is a valid unsigned integer.
func RandomString ¶
func SecureRandomBytes ¶
SecureRandomBytes returns the requested number of bytes using crypto/rand
func SliceEqual ¶
func SliceEqual[T comparable](slice1 []T, slice2 []T) bool
func SliceInsertBeforeElement ¶
func SliceInsertBeforeElement[T comparable](slice []T, newElement T, checkIndexFn func(element T) bool) []T
Types ¶
Click to show internal directories.
Click to hide internal directories.