Documentation
¶
Index ¶
- func ContainsSameAndNoDuplicates[T comparable](a, b []T) bool
- func FormatInt(v int) string
- func GenerateRandomBytes(n int) ([]byte, error)
- func GenerateRandomString(n int) (string, error)
- func GenerateRandomStringAlphabet(n int, letters string) (string, error)
- func GenerateRandomStringURLSafe(n int) (string, error)
- func HasDuplicates[T comparable](a []T) bool
- func MapSlice[T, U any](ts []T, f func(T) U) []U
- func MergeArrays[T cmp.Ordered](a, b []T) []T
- func MergeArraysNoSort[T comparable](a, b []T) []T
- func ParseStringArrayToUUID(ids []string) []uuid.UUID
- func RandomInt32() int32
- func RandomPositiveInt32() int32
- func RandomUint32() uint32
- func StringifyUUIDArray(uuids []uuid.UUID) []string
- func URLParamInt64(r *http.Request, name string) (int64, error)deprecated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsSameAndNoDuplicates ¶
func ContainsSameAndNoDuplicates[T comparable](a, b []T) bool
func GenerateRandomBytes ¶
generateRandomBytes returns securely generated random bytes. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func GenerateRandomString ¶
GenerateRandomString returns a securely generated random string. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func GenerateRandomStringURLSafe ¶
GenerateRandomStringURLSafe returns a URL-safe, base64 encoded securely generated random string. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func HasDuplicates ¶
func HasDuplicates[T comparable](a []T) bool
func MergeArrays ¶
func MergeArraysNoSort ¶
func MergeArraysNoSort[T comparable](a, b []T) []T
func ParseStringArrayToUUID ¶
func RandomInt32 ¶
func RandomInt32() int32
func RandomPositiveInt32 ¶
func RandomPositiveInt32() int32
func RandomUint32 ¶
func RandomUint32() uint32
func StringifyUUIDArray ¶
Types ¶
This section is empty.