BaseTempFile

package
v5.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//OpenSub 是否启动订阅
	OpenSub = false
)

Functions

func CreateTempFileSrc

func CreateTempFileSrc(dir string, fileName string, fileType string) (src string, name string, err error)

CreateTempFileSrc 创建临时文件 Deprecated

func DownloadFile

func DownloadFile(c *Router2Mid.RouterURLPublicC)

func Init

func Init()

Init 临时文件处理包

func LoadImgFile

func LoadImgFile(c *Router2Mid.RouterURLPublicC)

func SaveFile

func SaveFile(expireSec int, fileParams string, fileName string, fileSha1 string, fileType string) (fileSrc string, newID int64, hash string, err error)

SaveFile 保存文件

func SaveFileBefore

func SaveFileBefore(fileParams string) (newID int64, hash string, b bool)

SaveFileBefore 检查预加载文件

func UploadFileToTemp added in v5.2.35

func UploadFileToTemp(c *gin.Context, formName string, maxSize int64, filterType []string) (result CoreFile.DataGetUploadFileData, err error)

UploadFileToTemp 将上传文件存储到临时文件

Types

type FieldsFile

type FieldsFile struct {
	//ID
	ID int64 `db:"id" json:"id"`
	//创建时间
	CreateAt time.Time `db:"create_at" json:"createAt"`
	//过期时间
	ExpireAt time.Time `db:"expire_at" json:"expireAt"`
	//文件参数值
	// 可用于文件缓存,避免重复生成文件的负担
	FileParams string `db:"file_params" json:"fileParams"`
	//文件路径
	FileSrc string `db:"file_src" json:"fileSrc"`
	//文件SHA1
	FileSHA1 string `db:"file_sha1" json:"fileSHA1"`
	//文件名称
	Name string `db:"name" json:"name"`
	//文件类型
	FileType string `db:"file_type" json:"fileType"`
}

Jump to

Keyboard shortcuts

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