Documentation ¶
Index ¶
- func EmptyValue(s *string) bool
- func GenerateSalt() string
- func GetPage[T any](list []T, pageSize, page int) []T
- func HashString(token string) string
- func HashStringAlphanumeric(token string) string
- func HashStringAlphanumericLower(token string) string
- func HashStringRfc1123(token string) string
- func Int64Ptr(i int64) *int64
- func NonZeroOrNil(t time.Time) *time.Time
- func PrettyPrintError(err error)
- func PtrOf[T any](v T) *T
- func StrPtr(s string) *string
- func WithoutNils[T any](slice []*T) []T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmptyValue ¶
EmptyValue checks if a string pointer is nil or empty
func GenerateSalt ¶
func GenerateSalt() string
GenerateSalt generates the salt that can be used when hashing a password
func HashString ¶
HashString hashes a string using sha256 and returns the base64 encoded string
func HashStringAlphanumeric ¶
HashStringAlphanumeric hashes a string using sha256 and returns the base64 encoded string It also removes the characters that are not allowed in a alphanumeric string
func HashStringAlphanumericLower ¶
HashStringAlphanumericLower is a lowercase version of HashStringAlphanumeric
func HashStringRfc1123 ¶
HashStringRfc1123 hashes a string using sha256 and returns the base64 encoded string It also removes the characters that are not allowed in a RFC1123 string
func NonZeroOrNil ¶
NonZeroOrNil returns a pointer to a time.Time if the time is not zero, otherwise it returns nil
func PrettyPrintError ¶
func PrettyPrintError(err error)
PrettyPrintError prints an error in a pretty way It splits on `details: ` and adds `due to: \n`
func WithoutNils ¶
func WithoutNils[T any](slice []*T) []T
Types ¶
This section is empty.