Help us shape the future of Go! Take the 2026 Go Developer Survey

models

package
v0.9.78 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Permission

type Permission struct {
	ID        int
	Resource  string
	Action    string
	CreatedAt time.Time
}

func (Permission) TableName

func (Permission) TableName() string

type Role

type Role struct {
	ID          int
	Name        string
	Description string
	IsSystem    bool
	CreatedAt   time.Time
	UpdatedAt   time.Time
	DeletedAt   gorm.DeletedAt

	Permissions []Permission `gorm:"-"`
}

func (Role) TableName

func (Role) TableName() string

type Token

type Token struct {
	ID         int
	UUID       uuid.UUID
	UserID     int
	Token      string
	Name       string
	LastUsedAt sql.Null[time.Time]
	ExpiresAt  sql.Null[time.Time]
	CreatedAt  time.Time
	UpdatedAt  time.Time
	DeletedAt  gorm.DeletedAt

	Permissions []Permission `gorm:"-"`
}

func (*Token) PermissionList

func (a *Token) PermissionList() []string

func (*Token) TableName

func (*Token) TableName() string

type User

type User struct {
	ID        int
	UUID      uuid.UUID
	Email     string
	Password  sql.Null[string]
	Status    string
	IsSystem  bool
	Metadata  json.RawMessage
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt

	Roles []Role `gorm:"-"`
}

func (*User) IsActive

func (u *User) IsActive() bool

func (*User) PermissionList

func (u *User) PermissionList() []string

func (*User) RoleList

func (u *User) RoleList() []string

func (*User) SetPassword

func (u *User) SetPassword(password string) (err error)

func (*User) TableName

func (*User) TableName() string

type UserHistoryRecord

type UserHistoryRecord struct {
	ID         uuid.UUID
	OccurredAt time.Time
	CreatedAt  time.Time
	UserID     int
	EventType  string
	Data       []byte
	Metadata   string
}

func (UserHistoryRecord) TableName

func (UserHistoryRecord) TableName() string

type UserRole

type UserRole struct {
	UserID    int
	RoleID    int
	CreatedAt time.Time
	ExpiresAt sql.Null[time.Time]
}

func (UserRole) TableName

func (UserRole) TableName() string

Jump to

Keyboard shortcuts

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