util

package
v0.0.0-...-db09f8a Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MailPattern = "[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+"
)

Variables

This section is empty.

Functions

func CompareBcrypt

func CompareBcrypt(wanted, actual, pepper string) bool

func ContainsString

func ContainsString(needle string, haystack []string) bool

func HashBcrypt

func HashBcrypt(plain, pepper string) string

func IsEmail

func IsEmail(s string) bool

func RandomString

func RandomString(n int) string

func RandomStringSeeded

func RandomStringSeeded(n int, seed string) string

func RespondEmpty

func RespondEmpty(w http.ResponseWriter, r *http.Request, status int)

func RespondError

func RespondError(w http.ResponseWriter, r *http.Request, status int, err error)

func RespondErrorMessage

func RespondErrorMessage(w http.ResponseWriter, r *http.Request, status int, err error)

func RespondHtml

func RespondHtml(w http.ResponseWriter, status int, data string)

func RespondJson

func RespondJson(w http.ResponseWriter, status int, object interface{})

Types

This section is empty.

Jump to

Keyboard shortcuts

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