Documentation
¶
Index ¶
- func ErrorJSON(w http.ResponseWriter, err error, status ...int) error
- func GenerateRandomBytes(n int) ([]byte, error)
- func GenerateRandomString(n int) (string, error)
- func GenerateRandomStringURLSafe(n int) (string, error)
- func GetMapstructureTags(o any) []string
- func WriteJSON(w http.ResponseWriter, status int, data interface{}, headers ...http.Header) error
- type JSONResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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.