Documentation ¶
Index ¶
- func ClearEmptyStringPointer(v *string) *string
- func Contains(needle []string, haystack string, caseInsensitive bool) bool
- func FNV1Hash(val string) uint32
- func GenerateRandomBytes(n int) ([]byte, error)
- func GenerateRandomString(n int) (string, error)
- func InterpolateString(val string, env ...map[string]interface{}) (string, error)
- func JSONStringify(val any, pretty ...bool) string
- func Mask(s string) string
- func MaskArguments(args []string) []string
- func MaskEmail(val string) string
- func MaskHeaders(h http.Header, maskHeaders []string) map[string]string
- func MaskURL(urlString string) (string, error)
- func Modulo(value string, num int) int
- func NewHash(val ...interface{}) string
- func NewHash64(val ...interface{}) uint64
- func SHA256(data []byte, extra ...[]byte) string
- func StringPointer(v string) *string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearEmptyStringPointer ¶ added in v0.0.71
ClearEmptyStringPointer will set the pointer to nil if the string is not nil but an empty string
func FNV1Hash ¶ added in v0.0.71
FNV1Hash will take a string and return a FNV-1 hash value as a uint32
func GenerateRandomBytes ¶ added in v0.0.22
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 ¶ added in v0.0.22
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 InterpolateString ¶ added in v0.0.9
InterpolateString replaces { } in string with values from environment maps.
func JSONStringify ¶ added in v0.0.71
JSONStringify converts any value to a JSON string.
func MaskArguments ¶ added in v0.0.71
MaskArguments masks sensitive information in the given arguments.
func MaskEmail ¶ added in v0.0.71
MaskEmail masks the email address attempting to hide sensitive information.
func MaskHeaders ¶
MaskHeaders will return a stringified version of headers masking the headers passed in by name
func MaskURL ¶ added in v0.0.71
MaskURL returns a masked version of the URL string attempting to hide sensitive information.
func NewHash ¶ added in v0.0.71
func NewHash(val ...interface{}) string
NewHash returns a hash of one or more input variables using xxhash algorithm
func StringPointer ¶ added in v0.0.71
StringPointer will set the pointer to nil if the string is not nil but an empty string
Types ¶
This section is empty.