model

package
v0.0.0-...-a1c7362 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2019 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	ID        uint `gorm:"primary_key"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time
}

Model : gorm.Model definition

type User

type User struct {
	gorm.Model
	Email     string `gorm:"type:varchar(100);not null"`
	Password  string `gorm:"not null"`
	FirstName string `gorm:"type:varchar(50);not null"`
	LastName  string `gorm:"type:varchar(50);not null"`
	Bio       string
	Avatar    string
}

User : Model with injected fields `ID`, `CreatedAt`, `UpdatedAt`

func (*User) ComparePassword

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

ComparePassword : compare the password

func (*User) HashPassword

func (user *User) HashPassword()

HashPassword : hashing the password

Jump to

Keyboard shortcuts

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