users

package
v0.0.0-...-aa12bb5 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func GetUserIdByUsername

func GetUserIdByUsername(ctx context.Context, username string) (int, error)

func HashPassword

func HashPassword(password string) (string, error)

Types

type User

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

func GetUserById

func GetUserById(ctx context.Context, id string) (User, error)

func (*User) Authenticate

func (user *User) Authenticate(ctx context.Context) bool

func (*User) Create

func (user *User) Create(ctx context.Context)

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