models

package
v0.0.0-...-bddbd42 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUser

func AddUser(u User) string

func CheckPasswordHash

func CheckPasswordHash(existing, incoming string) bool

func DeleteUser

func DeleteUser(id int) int64

func HashPassword

func HashPassword(password string) (string, error)

func UserTable

func UserTable() orm.QuerySeter

UserTable Table

Types

type User

type User struct {
	ID       int    `json:"id" orm:"column(id);pk;auto;unique"`
	Name     string `json:"name" orm:"column(name)"`
	Email    string `json:"email" orm:"column(email)"`
	Address  string `json:"address" orm:"column(address)"`
	Password string `json:"password,omitempty" orm:"column(password)"`
	Token    string `json:"token" orm:"-"`
}

User Models

func GetAllUsers

func GetAllUsers() []User

func GetUser

func GetUser(uid int) (u User, err error)

func Login

func Login(usrs User) (isSuccess bool, usr User)

func UpdateUser

func UpdateUser(usr User) (a User, err error)

func (*User) TableName

func (u *User) TableName() string

TableName of User

Jump to

Keyboard shortcuts

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