models

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Anonymous = User{ID: 0}

Anonymous user object

Functions

This section is empty.

Types

type User

type User struct {
	ID    uint64 `json:"id" gorm:"primaryKey"`
	Email string `json:"email"`

	Password              string `json:"password"`
	RequiredPasswordReset bool   `json:"required_password_reset"`

	Approve models.ApproveStatus `gorm:"column:approve_status" db:"approve_status" json:"approve_status"`

	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `json:"deleted_at"`
}

User direct defenition

func (*User) CreatorUserID

func (u *User) CreatorUserID() uint64

CreatorUserID returns the user id

func (*User) GetID

func (u *User) GetID() uint64

GetID returns user ID

func (*User) IsAnonymous

func (u *User) IsAnonymous() bool

IsAnonymous user object nolint:unused // temporary

func (*User) IsNil

func (u *User) IsNil() bool

IsNil checks if the user is nil

func (*User) RBACResourceName

func (u *User) RBACResourceName() string

RBACResourceName returns the name of the resource for the RBAC

func (*User) TableName

func (u *User) TableName() string

TableName returns the name in database

type UserPasswordReset

type UserPasswordReset struct {
	UserID uint64 `json:"user_id" gorm:"primaryKey"`
	Token  string `json:"token" gorm:"index:,unique" limit:"128"`

	CreatedAt time.Time `json:"created_at"`
	ExpiresAt time.Time `json:"expires_at"`
}

UserPasswordReset direct defenition

func (*UserPasswordReset) TableName

func (u *UserPasswordReset) TableName() string

TableName returns the name in database

Jump to

Keyboard shortcuts

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