entity

package
v0.0.0-...-3f60b23 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	Base

	ObjectName string
	FileName   string
	ByteSize   int64
}

func NewAttachmentFromFile

func NewAttachmentFromFile(file *os.File) (*Attachment, error)

func NewAttachmentFromFileHeader

func NewAttachmentFromFileHeader(fileHeader *multipart.FileHeader) *Attachment

type Base

type Base struct {
	Id        uuid.UUID `bun:"id,pk,type:uuid,default:uuidv7()"`
	CreatedAt time.Time `bun:"created_at,nullzero,notnull,default:now()"`
	UpdatedAt time.Time `bun:"updated_at,nullzero,notnull,default:now()"`
}

func (*Base) BeforeUpdate

func (b *Base) BeforeUpdate(ctx context.Context, query *bun.UpdateQuery) error

type User

type User struct {
	Base

	Name           string
	EmailAddress   string
	PasswordDigest string
}

func (*User) ComparePassword

func (u *User) ComparePassword(password string) error

func (*User) HashPassword

func (u *User) HashPassword(password string) error

type UserSession

type UserSession struct {
	Base

	UserId    uuid.UUID
	User      *User `bun:"rel:belongs-to,join:user_id=id"`
	Token     string
	IpAddress string
	UserAgent string
}

func (*UserSession) GenerateToken

func (as *UserSession) GenerateToken()

Jump to

Keyboard shortcuts

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