fileUsage

package
v0.2.56 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TargetTopic       = "topic"
	TargetPost        = "post"
	TargetUser        = "user"
	TargetAdminUpload = "admin_upload"
)
View Source
const (
	UsageInlineImage = "inline_image"
	UsageAvatar      = "avatar"
	UsageAdminUpload = "admin_upload"
)

Variables

This section is empty.

Functions

func Create

func Create(entity *Entity) error

func ReplaceTargetUsages

func ReplaceTargetUsages(targetType string, targetId uint64, usageTypes []string, usages []Entity) error

Types

type Entity

type Entity struct {
	Id         uint64    `gorm:"primaryKey;column:id;autoIncrement;not null;" json:"id"`
	FileName   string    `` /* 128-byte string literal not displayed */
	TargetType string    `` /* 131-byte string literal not displayed */
	TargetId   uint64    `` /* 130-byte string literal not displayed */
	UsageType  string    `` /* 129-byte string literal not displayed */
	UserId     uint64    `gorm:"column:user_id;type:bigint unsigned;not null;default:0;" json:"userId"`
	CreatedAt  time.Time `gorm:"column:created_at;autoCreateTime;<-:create;" json:"createdAt"`
	UpdatedAt  time.Time `gorm:"column:updated_at;autoUpdateTime;" json:"updatedAt"`
}

func (*Entity) TableName

func (itself *Entity) TableName() string

Jump to

Keyboard shortcuts

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