model

package
v0.0.0-...-0ac623b Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequestID contextKey = iota
	CurrentUser
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LoginDTO

type LoginDTO struct {
	Email    string `json:"email" validate:"required,email"`
	Password string `json:"password" validate:"required"`
}

type RegisterDTO

type RegisterDTO struct {
	FirstName string `json:"first_name" validate:"required,min=2,max=25"`
	LastName  string `json:"last_name" validate:"required,min=2,max=25"`
	Email     string `json:"email" validate:"required,email"`
	Password  string `json:"password" validate:"required"`
}

type ResponseMessage

type ResponseMessage struct {
	Message string `json:"title"`
}

type TokenInfo

type TokenInfo struct {
	Email      string
	FirstName  string
	LastName   string
	Subject    string
	Expiration int
}

type User

type User struct {
	gorm.Model
	FirstName    string `gorm:"size:25;default:null;not null;type:text"`
	LastName     string `gorm:"size:25;default:null;not null;type:text"`
	Email        string `gorm:"unique;type:text"`
	PasswordHash string `gorm:"default:null;not null;type:text"`
}

type UserLoginModel

type UserLoginModel struct {
	Email     string
	FirstName string
	LastName  string
}

Jump to

Keyboard shortcuts

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