misc

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Env

func Env(key, def string) string

Env looks up a value for environment variable and returns it. If not found it returns the given default value.

func GenerateRandomKey

func GenerateRandomKey(length int) []byte

GenerateRandomKey generates a cryptographically secure random key of a given length.

func RandomString

func RandomString(n int) string

RandomString generates a cryptographically secure password of a given length which consists of alpha numeric characters and at least one 'special' one.

func SendMail

func SendMail(cfg database.Configuration, address, subject, body string) error

SendMail sends an email to a given address with a given subject and body. The credentials to contact the SMPT server are taken from the configuration.

Types

This section is empty.

Jump to

Keyboard shortcuts

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