Documentation
¶
Overview ¶
Package env contains code for handling environment variables
Index ¶
- func GenerateRandomKey(length int) []byte
- func GetBase64(varName string) ([]byte, error)
- func GetBool(varName string) (bool, error)
- func GetFloat32(varName string, defaultValue float32) (float32, error)
- func GetInt64(varName string, defaultValue int64) (int64, error)
- func GetKey(varName string, length int) ([]byte, error)
- func GetString(varName string, defaultValue string) string
- func GetURL(varName string, defaultValue string) (*url.URL, error)
- func GetURLOrigin(varName, defaultValue, defaultScheme string) (*url.URL, error)
- func GetUint64(varName string, defaultValue uint64) (uint64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateRandomKey ¶
GenerateRandomKey creates a random key with the given length in bytes. On failure, returns nil.
Note that keys created using `GenerateRandomKey()` are not automatically persisted. New keys will be created when the application is restarted, and previously issued cookies will not be able to be decoded.
Callers should explicitly check for the possibility of a nil return, treat it as a failure of the system random number generator, and not continue.
func GetURLOrigin ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.