Documentation ¶
Index ¶
- func Decode(src string) ([]byte, error)
- func Encode(src []byte) string
- func ErrorHandler(e error, fatal bool) bool
- func GenerateToken(len int) (string, error)
- func GetFlash(w http.ResponseWriter, r *http.Request, name string) ([]byte, error)
- func IsEmailValid(e string) bool
- func SetFlash(w http.ResponseWriter, name string, value []byte)
- func TrimWhitespace(str string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorHandler ¶
ErrorHandler is a utility function to handle errors so we don't have to write
if err != nil { // Do something here }
func GenerateToken ¶
GenerateToken generates a random string of len length
func IsEmailValid ¶
IsEmailValid checks if the email provided passes the required structure and length.
func SetFlash ¶
func SetFlash(w http.ResponseWriter, name string, value []byte)
SetFlash sets a cookie which expires after the next page load
func TrimWhitespace ¶
TrimWhitespace takes a string and removes any spaces
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.