models

package
Version: v0.0.0-...-f809b4b Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Post

type Post struct {
	ID      int    `json:"id"`
	UserID  int    `json:"user"`
	Title   string `json:"title"`
	Message string `json:"message"`
}

Post ...

type Token

type Token struct {
	UserID string
	jwt.StandardClaims
}

Token ...

type User

type User struct {
	ID          string    `json:"id"`
	UserName    string    `json:"username"`
	Email       string    `json:"email"`
	Password    string    `json:"password"`
	Number      string    `json:"number"`
	Male        bool      `json:"male"`
	Country     string    `json:"country"`
	DateOfBirth time.Time `json:"dob"`
	About       string    `json:"about"`
}

User ...

func (*User) BeforeCreate

func (u *User) BeforeCreate(*gorm.DB) error

BeforeCreate ...

func (*User) ComparePassword

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

ComparePassword ...

func (*User) Sanitize

func (u *User) Sanitize()

Sanitize ...

func (*User) Validate

func (u *User) Validate() bool

Validate ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL