users

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2020 License: GPL-3.0 Imports: 14 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 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