model

package
v0.0.0-...-a61ba57 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Profile

type Profile struct {
	UserID    int    `json:"user_id" gorm:"association_foreignkey:id"`
	UserEmail string `json:"user_email"`
	About     string `json:"about,omitempty"`
}

Profile of user

type User

type User struct {
	ID                int    `json:"id" gorm:"not null;primary key"`
	Password          string `sql:"-" json:"-"`
	Email             string `gorm:"not null;unique" json:"email"`
	EncryptedPassword string `json:"encrypted_password,omitempty"`
	JwtToken          string `sql:"jwt_token" json:"-"`
}

User a struct of user info

func TestUser

func TestUser(t *testing.T) *User

TestUser ...

func (*User) BeforeCreate

func (u *User) BeforeCreate() error

BeforeCreate a func for create hashed passw

func (*User) ComparePassword

func (u *User) ComparePassword(password string) bool

ComparePassword ...

func (*User) Sanitize

func (u *User) Sanitize()

Sanitize make passw empty

func (*User) Validate

func (u *User) Validate() error

Validate a validate of user

Jump to

Keyboard shortcuts

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