user

package
v0.0.0-...-99248c7 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticationController

type AuthenticationController struct {
	// contains filtered or unexported fields
}

func (*AuthenticationController) Signin

func (a *AuthenticationController) Signin(ctx *gin.Context)

func (*AuthenticationController) Signup

func (a *AuthenticationController) Signup(ctx *gin.Context)

type HashSalt

type HashSalt struct {
	Hash, Salt       []byte
	HashB64, SaltB64 string
}

type PasswordService

type PasswordService struct {
	// contains filtered or unexported fields
}

func NewPasswordService

func NewPasswordService(time, saltLen uint32, memory uint32, threads uint8, keyLen uint32) *PasswordService

func (*PasswordService) Compare

func (p *PasswordService) Compare(hash, salt, password string) error

Compare generated hash with store hash.

func (*PasswordService) GenerateHash

func (p *PasswordService) GenerateHash(password string, salt string) (*HashSalt, error)

GenerateHash using the password and provided salt. If not salt value provided fallback to random value generated of a given length.

type RestService

type RestService struct {
	// contains filtered or unexported fields
}

func NewRoute

func NewRoute(dbRepo interfaces.DBRepository) *RestService

func (*RestService) RegisterHandlers

func (r *RestService) RegisterHandlers(e *gin.Engine)

type User

type User struct {
	Id           int    `db:"id"`
	Name         string `db:"name"`
	Surname      string `db:"surname"`
	Email        string `db:"email"`
	PasswordHash string `db:"password_hash"`
	SaltHash     string `db:"salt_hash"`
	Enabled      bool   `db:"enabled"`
}

type UserController

type UserController struct {
	// contains filtered or unexported fields
}

func NewUserController

func NewUserController(db interfaces.DBRepository) *UserController

func (*UserController) GetAll

func (c *UserController) GetAll(ctx *gin.Context)

type Users

type Users []User

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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