Documentation ¶
Index ¶
- Variables
- func Decrypt(secret []byte, encrypted string) ([]byte, error)
- func Encrypt(secret []byte, value []byte) (string, error)
- func LoadEnv(env interface{}) error
- func NewLogger(service string) zerolog.Logger
- func ParseISO(date string) (time.Time, error)
- func RandomBytes(n int) ([]byte, error)
- func RandomString(s int) (string, error)
- func SimpleHeaders(headers http.Header) map[string]interface{}
- func Slugify(s string) string
- func WithCancel(parent context.Context) (context.Context, context.CancelFunc)
Constants ¶
This section is empty.
Variables ¶
var DumpLog = regexp.MustCompile("(?i)kube-probe|prometheus")
var ISO_FORMATS = [3]string{"2006-01-02T15:04:05.000Z", "2006-01-02", "2006-01-02T15:04:05"}
Functions ¶
func RandomBytes ¶
RandomBytes 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 RandomString ¶
RandomString returns a securely generated random hex 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. Keep in mind that s is the length of the returned string, not the number of bytes to be produced
func SimpleHeaders ¶ added in v0.16.0
SimpleHeaders is a transformer for headers. It:
- converts all header keys to lowercase
- all single value headers to strings
func WithCancel ¶
WithCancel replicates context.WithCancel but listens for Interrupt and SIGTERM signals
Types ¶
This section is empty.