models

package
v0.0.0-...-eddbae0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	ID         int32     `pg:"id" json:"id"`
	Email      string    `pg:"email" json:"email" binding:"required"`
	Password   string    `pg:"password" json:"-"`
	Number     string    `pg:"number" json:"number" binding:"required" validate:"min=8,max=12"`
	Name       string    `pg:"name" json:"name"`
	LoginTime  time.Time `pg:"login_at" json:"-"`
	LoginIP    net.IP    `pg:"login_ip" json:"-"`
	LoginCount int64     `pg:"login_count" json:"-"`
	Status     int       `pg:"status" json:"status"`
	Role       int       `pg:"role" json:"role,omitempty"`
	CreatedAt  time.Time `pg:"created_at" json:"createdAt,omitempty"`
	UpdatedAt  time.Time `pg:"updated_at" json:"updatedAt,omitempty"`
	DeletedAt  time.Time `pg:"deleted_at" json:"-"`
}

func (*User) Active

func (u *User) Active() bool

func (*User) ComparePassword

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

func (*User) HashedPassword

func (user *User) HashedPassword() error

func (*User) ValidateEmail

func (user *User) ValidateEmail() bool

func (*User) ValidatePassword

func (user *User) ValidatePassword() bool

Passwords must contain at least eight characters, including at least 1 letter and 1 number.

Jump to

Keyboard shortcuts

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