users

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2021 License: MIT Imports: 10 Imported by: 2

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 CheckStatusinSession

func CheckStatusinSession(id int64) bool

func HashPassword

func HashPassword(password string) (string, error)

HashPassword hashes given password

Types

type User

type User struct {
	ID          int    `json:"id"`
	FirstName   string `json:"firstname"`
	LastName    string `json:"lastname"`
	Password    string `json:"password"`
	Email       string `json:"email"`
	Mobile      string `json:"mobile"`
	CreatedDate string `json:"created"`
	Status      string `json:"status"`
	Roleid      int    `json:"roleid"`
	Referenceid int    `json:"referenceid"`
	LocationId  int    `json:"locationid"`
	Moduleid    int    `json:"moduleid"`
	Packageid   int    `json:"packageid"`
	Modulename  string `json:"modulename"`
	Tenantname  string `json:"tenantname"`
}

func GetAllUsers

func GetAllUsers() []User

func (*User) Authenticate

func (user *User) Authenticate() bool

func (*User) Create

func (user *User) Create() int64

func (*User) GetByUserId

func (user *User) GetByUserId(id int64) (*User, error)

func (*User) GetUserIdByUsername

func (user *User) GetUserIdByUsername(username string) (int, error)

func (*User) InsertToken

func (user *User) InsertToken(token string)

func (*User) InsertUserintoProfile

func (user *User) InsertUserintoProfile() int64

func (*User) LoginResponse added in v1.0.3

func (user *User) LoginResponse(id int64) (*User, error)

func (*User) ResetPassword

func (user *User) ResetPassword() bool

func (*User) RetrieveToken

func (user *User) RetrieveToken(c *gin.Context) bool

func (*User) UserAuthentication

func (user *User) UserAuthentication(id int64) (*User, bool, error)

Jump to

Keyboard shortcuts

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