Documentation ¶
Index ¶
- Constants
- func CleanDownloadingFiles() error
- func DeleteEmptyFolder(deletedFileAbsPath string)
- func DeleteFile(file_hash string) error
- func GetFileAbsPath(file_hash string) string
- func GetLastReqTime(file_hash string) (int64, error)
- func LoopDeleteEmptyFolder()
- func RemoveFileFromDisk(fileHash string)
- func ScanLeakFiles()
- func SetLastReqTime(file_hash string)
- func UpdateFile(newData map[string]interface{}, file_hash string) error
- func UrlHashToPublicFileRelPath(file_hash string) string
- type DiskFile
- type FileModel
- type QueryFileResult
Constants ¶
View Source
const STATUS_DOWNLOADED = "DOWNLOADED"
View Source
const STATUS_DOWNLOADING = "DOWNLOADING"
Variables ¶
This section is empty.
Functions ¶
func CleanDownloadingFiles ¶
func CleanDownloadingFiles() error
func DeleteEmptyFolder ¶
func DeleteEmptyFolder(deletedFileAbsPath string)
func DeleteFile ¶
func GetFileAbsPath ¶
func GetLastReqTime ¶
func LoopDeleteEmptyFolder ¶
func LoopDeleteEmptyFolder()
func RemoveFileFromDisk ¶
func RemoveFileFromDisk(fileHash string)
func SetLastReqTime ¶
func SetLastReqTime(file_hash string)
func UpdateFile ¶
func UrlHashToPublicFileRelPath ¶
file_hash to a rel_path to "public" folder
Types ¶
type FileModel ¶
type FileModel struct { File_hash string `json:"file_hash" gorm:"primaryKey"` Last_req_unixtime int64 `json:"last_req_unixtime" gorm:"index"` //Last_scan_unixtime int64 `json:"last_scan_unixtime" gorm:"index"` //Last_download_unixtime int64 `json:"last_download_unixtime"` Size_byte int64 `json:"size_byte" gorm:"index"` Rel_path string `json:"rel_path"` Status string `json:"status" gorm:"index"` }
func CreateFile ¶
func RequestPublicFile ¶
return abs_file_path file_header_json error
Click to show internal directories.
Click to hide internal directories.