Documentation
¶
Index ¶
- Variables
- func ConnectDatabase()
- func ExtractToken(c *gin.Context) string
- func ExtractTokenID(c *gin.Context) (uint, error)
- func GenerateToken(user_id uint) (string, error)
- func JwtAuthMiddleware() gin.HandlerFunc
- func LoginCheck(username string, password string) (string, error)
- func TokenValid(c *gin.Context) error
- func VerifyPassword(password, hashedPassword string) error
- type Claims
- type License
- type LicenseInput
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *gorm.DB
Functions ¶
func ConnectDatabase ¶
func ConnectDatabase()
func ExtractToken ¶
func GenerateToken ¶
func JwtAuthMiddleware ¶
func JwtAuthMiddleware() gin.HandlerFunc
func TokenValid ¶
func VerifyPassword ¶
Types ¶
type Claims ¶
type Claims struct {
Username string `json:"username"`
jwt.StandardClaims
}
Claims represents the JWT claims
type LicenseInput ¶
type User ¶
type User struct {
gorm.Model
Username string `gorm:"size:255;not null;unique" json:"username"`
Password string `gorm:"size:255;not null;" json:"password"`
}
func GetUserByID ¶
func (*User) BeforeSave ¶
func (*User) PrepareGive ¶
func (u *User) PrepareGive()
Click to show internal directories.
Click to hide internal directories.