Documentation ¶
Index ¶
- func BalanceTooLow(err error) bool
- func CheckOrder(s []byte) bool
- func CompareCookie(c, u, h, ip, r string) bool
- func ComparePassword(s, h string) bool
- func EmptyRow(err error) bool
- func GenerateCookieValue(u, h, ip, r string) string
- func GetUser(r *http.Request) (string, error)
- func OrderExists(err error) bool
- func OrderUnique(err error) bool
- func RandStringRunes(n int) string
- func SecurePassword(s string) (string, error)
- func SetCookie(w http.ResponseWriter, name, value string)
- func UserConflict(err error) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BalanceTooLow ¶
BalanceTooLow - checking the error for a low balance user error
func CheckOrder ¶
CheckOrder - checking order number by luhn algorithm
func CompareCookie ¶
CompareCookie - проверка значения cookie
c - cookie value,
u - username,
h - hashed password,
ip - user ip address,
r - random string
func ComparePassword ¶
Compare recieved password with stored value
func GenerateCookieValue ¶
GenerateCookieValue - генерация значения cookie
u - username,
h - hashed password,
ip - user ip address,
r - random string
func OrderExists ¶
OrderExists - checking the sql error for unique violation of order number and username pair
func OrderUnique ¶
OrderUnique - checking the sql error for unique violation of order number
func RandStringRunes ¶
RandStringRunes - generate random string with custom lenght
func SetCookie ¶
func SetCookie(w http.ResponseWriter, name, value string)
SetCookie - writing new cookie to web response
func UserConflict ¶
UserConflict - checking the sql error for unique violation of username
Types ¶
This section is empty.