models

package
v0.0.0-...-d41449d Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectAndMigrate

func ConnectAndMigrate() *gorm.DB

Types

type Role

type Role struct {
	gorm.Model
	Name string `gorm:"size:20"`
}

type User

type User struct {
	gorm.Model
	RoleID         uint
	Role           Role
	FirstName      string `gorm:"size:255"`
	LastName       string `gorm:"size:255"`
	Email          string `gorm:"type:varchar(100);unique_index"`
	Username       string `gorm:"type:varchar(30);unique_index"`
	HashedPassword string `gorm:"type:varchar(255)"`
	Gender         string
	IsActive       bool
}

func (*User) PasswordIsCorrect

func (user *User) PasswordIsCorrect(rawPassword string) bool

func (*User) SetNewPassword

func (user *User) SetNewPassword(rawPassword string)

Jump to

Keyboard shortcuts

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