models

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	ID           string     `gorm:"type:varchar(36);primary_key" json:"id"`
	Username     string     `gorm:"type:varchar(255);not null;uniqueIndex:idx_user_username" json:"username"`
	Email        string     `gorm:"type:varchar(255);uniqueIndex:idx_user_email" json:"email"`
	PasswordHash string     `gorm:"type:varchar(255);not null" json:"-"` // bcrypt hash (includes salt)
	DisplayName  string     `gorm:"type:varchar(255)" json:"display_name"`
	Roles        []string   `gorm:"type:text;serializer:json" json:"roles"` // Multiple roles stored as JSON array
	Status       string     `gorm:"type:varchar(50);default:'active';index:idx_user_status" json:"status"`
	LastLoginAt  *time.Time `gorm:"index:idx_user_last_login" json:"last_login_at"`
	CreatedAt    time.Time  `gorm:"index" json:"created_at"`
	UpdatedAt    time.Time  `gorm:"index" json:"updated_at"`
}

User represents a user in the system

func (User) TableName

func (User) TableName() string

TableName specifies the table name

Jump to

Keyboard shortcuts

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