Documentation ¶
Overview ¶
Package users - авторизация, регистрация юзеров и проверка прав для разделов сайта
Index ¶
- Constants
- Variables
- func GeneratePassword(email string) (string, error)
- func GenerateRandomBytes(n int) ([]byte, error)
- func GenerateRandomString(s int) (string, error)
- func HashPassword(password string) interface{}
- func SendMail(email, password string)
- func SetSessionPath(fSession string)
- type ErrNotLogin
- type UserRecord
Constants ¶
const NOT_AUTHORIZE = "Нет данных об авторизации!"
NOT_AUTHORIZE message for response
Variables ¶
var (
Store = sessions.NewFilesystemStore("/var/lib/php/session", []byte("travel.com.ua"))
)
Functions ¶
func GeneratePassword ¶
GeneratePassword run password by email
func GenerateRandomBytes ¶
GenerateRandomBytes 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 GenerateRandomString ¶
GenerateRandomString returns a URL-safe, base64 encoded securely generated random 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.
func HashPassword ¶
func HashPassword(password string) interface{}
HashPassword create hash from {password} & return checksumm
func SendMail ¶
func SendMail(email, password string)
SendMail create mail with new {password} & send to {email}
func SetSessionPath ¶
func SetSessionPath(fSession string)
SetSessionPath set path for session storage
Types ¶
type ErrNotLogin ¶ added in v1.0.11512
type ErrNotLogin struct {
Message string
}
func (ErrNotLogin) Error ¶ added in v1.0.11512
func (err ErrNotLogin) Error() string
type UserRecord ¶
UserRecord for user data
func CheckUserCredentials ¶
func CheckUserCredentials(login string, password string) (row UserRecord, err error)
CheckUserCredentials check user data & return id + name