Documentation ¶
Index ¶
- Constants
- func CreateDirectoryIfNotExists(path string, mode os.FileMode) error
- func DefaultLogger(debugMode bool, logDir string) (*zap.Logger, error)
- func Exists(path string) bool
- func IsTestMode() bool
- func MapStringKeys(m map[string]interface{}) (keys []string)
- func NewCSPRNG(nbytes int) ([]byte, error)
- func NewCSPRNGHex(nbytes int) (string, error)
- func PackU32s(a, b uint32) uint64
- func PrettyPrint(marshal bool, val interface{})
- func ProtectedChangelog(allowedFields map[string]bool, before, after interface{}) (diff.Changelog, error)
- func StringToSnake(s string) string
- func UnpackU32s(n uint64) (result [2]uint32)
- func WriteResponseErrorTo(w http.ResponseWriter, key string, err error, code int)
- type HTTPError
Constants ¶
View Source
const L32 = (^uint64(0) >> 32) << 32
L32 is the leftmost 32 bits set to 1s
View Source
const R32 = ^uint64(0) >> 32
R32 is the rightmost 32 bits set to 1s
Variables ¶
This section is empty.
Functions ¶
func CreateDirectoryIfNotExists ¶
CreateDirectoryIfNotExists creates directory if it doesn't yet exist
func DefaultLogger ¶
DefaultLogger initializing default logger
func IsTestMode ¶
func IsTestMode() bool
func MapStringKeys ¶
MapStringKeys returns a slice of map keys, given that this map is string-indexed
func NewCSPRNGHex ¶
NewCSPRNGHex is a string wrapper for NewCSPRNG
func PrettyPrint ¶
func PrettyPrint(marshal bool, val interface{})
func ProtectedChangelog ¶
func StringToSnake ¶
taken from, with courtesy of: elwinar (https://gist.github.com/elwinar/14e1e897fdbe4d3432e1)
func UnpackU32s ¶
func WriteResponseErrorTo ¶
func WriteResponseErrorTo(w http.ResponseWriter, key string, err error, code int)
WriteResponseErrorTo is a helper function that writes an error to a supplied http.ResponseWriter
Types ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.