models

package
v0.0.0-...-83afde1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUser

func AddUser(email, password, firstName, lastName string) error

AddUser will create a new user

func ChangeLoginStatus

func ChangeLoginStatus(email string)

func CheckAuth

func CheckAuth(email, password string) (bool, error)

func CheckLogin

func CheckLogin(email string) (bool, error)

false is login and true is not login

func CleanAllStatus

func CleanAllStatus()

func CloseDB

func CloseDB()

func DeleteUser

func DeleteUser()

func EncodePassword

func EncodePassword(cleartext string) string

func ExistUserByEmail

func ExistUserByEmail(email string) (bool, error)

ExistUserByEmail checks if ther has a user with same email

func FindUser

func FindUser(u []byte) (interface{}, error)

func FindUserByEmail

func FindUserByEmail(email string) ([]byte, error)

Types

type Model

type Model struct {
	ID         int `gorm:"primary_key" json:"id"`
	CreatedOn  int `json:"created_on"`
	ModifiedOn int `json:"modified_on"`
}

type User

type User struct {
	UserID       string `json:"id"`
	Username     string `json:"username"`
	Email        string `json:"email"`
	Password     string `json:"password"`
	FirstName    string `json:"firstName"`
	LastName     string `json:"lastName"`
	ProfileImage string `json:"profileImage"`
	Key          string `json:"key"`
	IsLogin      bool   `json:"isLogin"`
}

User struct is full table of user

Jump to

Keyboard shortcuts

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