added comments

This commit is contained in:
u80864958
2025-05-02 10:39:35 +02:00
parent fb7d5a623a
commit 14b57b57e8
16 changed files with 73 additions and 29 deletions

View File

@ -14,11 +14,13 @@ const (
RoleGuest Role = "guest"
)
// InvalidJWT Represents a JWT that has expired or is otherwise invalid.
type InvalidJWT struct {
JWT string `gorm:"primarykey"`
ValidUntil time.Time
}
// User represents a user with an ID, UUID, name, role, and password.
type User struct {
ID uint `gorm:"primarykey" json:"-"`
UUID uuid.UUID `gorm:"type:uuid" json:"uuid"`
@ -27,6 +29,7 @@ type User struct {
Password []byte `json:"-"`
}
// NewUser creates a new User struct with a generated UUID.
func NewUser() User {
return User{
UUID: uuid.New(),