users

package
v1.1.10011 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package users - авторизация, регистрация юзеров и проверка прав для разделов сайта

Index

Constants

View Source
const NOT_AUTHORIZE = "Нет данных об авторизации!"

NOT_AUTHORIZE message for response

Variables

View Source
var (
	Store = sessions.NewFilesystemStore("/var/lib/php/session", []byte("travel.com.ua"))
)

Functions

func GeneratePassword

func GeneratePassword(email string) (string, error)

GeneratePassword run password by email

func GenerateRandomBytes

func GenerateRandomBytes(n int) ([]byte, error)

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

func GenerateRandomString(s int) (string, error)

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

type UserRecord struct {
	Id   int
	Name string
	Sex  int
}

UserRecord for user data

func CheckUserCredentials

func CheckUserCredentials(login string, password string) (row UserRecord, err error)

CheckUserCredentials check user data & return id + name

Jump to

Keyboard shortcuts

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