fileUsage

package
v0.2.64 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TargetTopic         = "topic"
	TargetPost          = "post"
	TargetUser          = "user"
	TargetAdminUpload   = "admin_upload"
	TargetPendingUpload = "pending_upload"
	TargetUploadOwner   = "upload_owner"
)
View Source
const (
	UsageInlineImage   = "inline_image"
	UsageAvatar        = "avatar"
	UsageAdminUpload   = "admin_upload"
	UsagePendingUpload = "pending_upload"
	UsageUploadOwner   = "upload_owner"
)

Variables

This section is empty.

Functions

func Create

func Create(entity *Entity) error

func CreateIfAbsent added in v0.2.62

func CreateIfAbsent(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 GetByFileName added in v0.2.61

func GetByFileName(fileName string) ([]Entity, error)

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