string

package
v0.0.28 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(slice []string, search string, caseInsensitive bool) bool

Contains returns true if the search string is found in the slice

func GenerateRandomBytes added in v0.0.22

func GenerateRandomBytes(n int) ([]byte, error)

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

func GenerateRandomString(n int) (string, error)

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

func InterpolateString(val string, env ...map[string]interface{}) (string, error)

InterpolateString replaces { } in string with values from environment maps.

func Mask

func Mask(s string) string

func MaskHeaders

func MaskHeaders(h http.Header, maskHeaders []string) map[string]string

MaskHeaders will return a stringified version of headers masking the headers passed in by name

func SHA256 added in v0.0.6

func SHA256(data []byte, extra ...[]byte) string

SHA256 will return a sha 256 hash of the data in hex format

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL