service

package
v0.0.0-...-0de623a Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_PASSWORD = "21232f297a57a5a743894a0e4a801fc3"

Variables

This section is empty.

Functions

func ChangeHashPrefix

func ChangeHashPrefix(hashPrefix int) bool

func ChangeMaxFileSize

func ChangeMaxFileSize(size int) bool

func ChangePassword

func ChangePassword(oldPassword string, newPassword string) (success bool)

func ChangeTokenTtl

func ChangeTokenTtl(tokenTtl int64) bool

func DeleteFile

func DeleteFile(filename string) (result bool, reason string)

func ListFilesByCondition

func ListFilesByCondition(filename string, extension string, labels []string, tags []string,
	startTime string, endTime string, pageSize int, pageNum int) map[string]any

func Login

func Login(password string) (success bool, isFirst bool, token string)

func ModifyFile

func ModifyFile(nasuFile db.NasuFile) bool

func OverallExtensionInfo

func OverallExtensionInfo() (resultMap map[string]int)

func OverallFileInfo

func OverallFileInfo() (resultSlice []string)

func OverallLabelInfo

func OverallLabelInfo() (resultMap map[string]int)

func OverallTagInfo

func OverallTagInfo() (resultMap map[string]int)

func UploadFile

func UploadFile(file *multipart.FileHeader, filename string,
	labels []string, tags []string, uploadTime string, extension string) (success bool, reason string)

UploadFile 上传一个文件到某个路径(路径由文件哈希值决定)。该方法包括预检验重名文件,拷贝文件,更新数据库

Types

This section is empty.

Jump to

Keyboard shortcuts

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