models

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminUser

type AdminUser struct {
	ID           uint   `gorm:"primaryKey"`
	Email        string `gorm:"uniqueIndex"`
	PasswordHash string
	Role         string
}

AdminUser represents a person who can log in to the admin panel.

func (*AdminUser) CheckPassword

func (u *AdminUser) CheckPassword(password string) bool

func (*AdminUser) SetPassword

func (u *AdminUser) SetPassword(password string) error

type AuditLog

type AuditLog struct {
	ID           uint `gorm:"primaryKey"`
	UserID       uint `gorm:"index"`
	UserEmail    string
	ResourceName string `gorm:"index"`
	RecordID     string `gorm:"index"`
	Action       string
	Changes      string
	CreatedAt    time.Time `gorm:"index"`
}

AuditLog records every change made in the admin panel.

type Permission

type Permission struct {
	ID           uint   `gorm:"primaryKey"`
	Role         string `gorm:"index"`
	ResourceName string `gorm:"index"`
	Action       string
}

Permission defines what a role can do with a resource.

type Session

type Session struct {
	ID        string    `gorm:"primaryKey"`
	UserID    uint      `gorm:"index"`
	ExpiresAt time.Time `gorm:"index"`
}

Session stores active login sessions.

Jump to

Keyboard shortcuts

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