models

package
v0.0.0-...-61bc911 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func InitDB

func InitDB(cfg Config)

Types

type Claims

type Claims struct {
	Role string `json:"role"`
	jwt.RegisteredClaims
}

type ClaimsRefresh

type ClaimsRefresh struct {
	Role   string `json:"role"`
	UserId uint   `json:"user_id"`
	jwt.RegisteredClaims
}

type Config

type Config struct {
	Host     string
	Port     string
	User     string
	Password string
	DBName   string
	SSLMode  string
}

type RefreshToken

type RefreshToken struct {
	RefreshToken string `json:"refresh_token" binding:"required"`
}

type User

type User struct {
	gorm.Model
	Name     string `json:"name,omitempty"`
	Email    string `gorm:"unique" json:"email" binding:"required"`
	Password string `json:"password" binding:"required"`
	Role     string `json:"role"`
}

type UserPatch

type UserPatch struct {
	Name string `json:"name" binding:"required"`
}

Jump to

Keyboard shortcuts

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