users

package
v0.0.0-...-060ba56 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

CheckPassword hash compares raw password with it's hashed values

func GetUserIdByUsername

func GetUserIdByUsername(username string) (int, error)

GetUserIdByUsername check if a user exists in database by given userename

func HashPassword

func HashPassword(password string) (string, error)

HashPassword hashes given password

Types

type User

type User struct {
	ID       string `json:"id"`
	Username string `json:"name"`
	Password string `json:"password"`
}

func (*User) Authenticate

func (user *User) Authenticate() bool

func (*User) Create

func (user *User) Create()

type WrongUsernameOrPasswordError

type WrongUsernameOrPasswordError struct{}

func (*WrongUsernameOrPasswordError) Error

Jump to

Keyboard shortcuts

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