models

package
v0.0.0-...-6468967 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrExpiredToken = errors.New("token expired")

Functions

This section is empty.

Types

type Login

type Login struct {
	Email    string `form:"email"`
	Password string `form:"password"`
}

type Payload

type Payload struct {
	ID        uuid.UUID
	Username  string
	IssuedAt  time.Time
	ExpiredAt time.Time
}

func NewPayload

func NewPayload(username string, duration time.Duration) (*Payload, error)

func (*Payload) Valid

func (payload *Payload) Valid() error

type User

type User struct {
	gorm.Model
	Username string
	Email    string `gorm:"type:varchar(100);unique_index"`
	Password string `json:"Password"`
}

func (*User) EncryptPasswd

func (u *User) EncryptPasswd() error

Jump to

Keyboard shortcuts

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