models

package
v0.0.0-...-9ffdc33 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claims

type Claims struct {
	UserID string
	Email  string
	jwt.StandardClaims
}

Claims represents a model for JWT

type HTTPErrorStatus

type HTTPErrorStatus struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

HTTPErrorStatus represents the model for a HTTP response

type TokenPayload

type TokenPayload struct {
	Token string `json:"token"`
}

TokenPayload represents model for the token payload

type User

type User struct {
	gorm.Model
	Email    string `gorm:"unique_index;not null;default:''"`
	Password string `gorm:"not null;default:''"`
}

User represents a model for a user

func (User) Validate

func (user User) Validate(db *gorm.DB)

Validate method validates a given model

Jump to

Keyboard shortcuts

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