Documentation ¶
Index ¶
- func AddCachedFile(info *CachedFile) error
- func AddDownloadingFile(info *DownloadingFile) error
- func AddFolderToDB(id uint32, absPath string) error
- func DeleteCachedFile(nameHash []string) error
- func DeleteCachedFileByFolderID(folderID uint32) error
- func DeleteDownloadingFile(nameHash []string) error
- func DeleteDownloadingFileByFolderID(folderID uint32) error
- func GetCachedFileDistinctFolderID() ([]uint32, error)
- func GetCachedFileNameByFolderID(folderID uint32, limit int, offset int) ([]string, error)
- func GetCachedFileNameInGivenNames(fileNames []string) ([]string, error)
- func GetDownloadingFileDistinctFolderID() ([]uint32, error)
- func GetDownloadingFileNameByFolderID(folderID uint32, limit int, offset int) ([]string, error)
- func GetDownloadingFileNameByState(state DownloadState, limit int, offset int) ([]string, error)
- func GetDownloadingFileNameInGivenNames(fileNames []string) ([]string, error)
- func GetTotalCachedFileCount() (int64, error)
- func InitLocalDB(absDbFolder string, logger ULog.Logger) error
- func SetDownloadingFileDeleteTag(nameHash []string) (int64, error)
- func UpdateDownloadTask(nameHash string, newValueMap map[string]interface{}) error
- func UpdateLastAccessTime(nameHash string, lastAccessTime int64) (int64, error)
- type CachedFile
- func BatchGetCachedFile(limit int, offset int) ([]*CachedFile, error)
- func GetCachedFile(nameHash string) (*CachedFile, error)
- func GetCachedFileInfoByGivenNames(fileNames []string) ([]*CachedFile, error)
- func GetFilesBeforeAccessTime(limitLineUnix int64, limit int, offset int) ([]*CachedFile, error)
- func GetFilesOrderByAccessTime(limit int) ([]*CachedFile, error)
- type DownloadState
- type DownloadingFile
- type Folder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCachedFile ¶
func AddCachedFile(info *CachedFile) error
func AddDownloadingFile ¶
func AddDownloadingFile(info *DownloadingFile) error
func AddFolderToDB ¶
func DeleteCachedFile ¶
func DeleteDownloadingFile ¶
func GetDownloadingFileNameByState ¶
func GetDownloadingFileNameByState(state DownloadState, limit int, offset int) ([]string, error)
func GetTotalCachedFileCount ¶
func UpdateDownloadTask ¶
Types ¶
type CachedFile ¶
type CachedFile struct { NameHash string `gorm:"primarykey;size:16"` FolderID uint32 `gorm:"index"` Size int64 LastAccessTime int64 `gorm:"index"` Encrypted bool IsTempFile bool `gorm:"index"` }
func BatchGetCachedFile ¶
func BatchGetCachedFile(limit int, offset int) ([]*CachedFile, error)
func GetCachedFile ¶
func GetCachedFile(nameHash string) (*CachedFile, error)
func GetCachedFileInfoByGivenNames ¶
func GetCachedFileInfoByGivenNames(fileNames []string) ([]*CachedFile, error)
func GetFilesBeforeAccessTime ¶
func GetFilesBeforeAccessTime(limitLineUnix int64, limit int, offset int) ([]*CachedFile, error)
func GetFilesOrderByAccessTime ¶
func GetFilesOrderByAccessTime(limit int) ([]*CachedFile, error)
type DownloadState ¶
type DownloadState string
const ( DownloadState_Downloading DownloadState = "downloading" DownloadState_Success DownloadState = "success" DownloadState_Failed DownloadState = "failed" )
type DownloadingFile ¶
type DownloadingFile struct { NameHash string `gorm:"primarykey;size:16"` TaskId uint64 `gorm:"index"` FolderID uint32 `gorm:"index"` OriginUrl urlArray UsingUrlIndex int TaskType downloadmgr.TaskType `gorm:"index"` Encrypted bool SizeLimit int64 CreatedTimeStamp int64 `gorm:"index"` ExpireTimeStamp int64 `gorm:"index"` State DownloadState `gorm:"index"` //downloading, success, failed FailReason downloadmgr.FailReasonType FileSize int64 }
func BatchGetDownloadingFile ¶
func BatchGetDownloadingFile(conditions map[string]interface{}, limit int, offset int) ([]*DownloadingFile, error)
func GetDownloadingFile ¶
func GetDownloadingFile(nameHash string) (*DownloadingFile, error)
Click to show internal directories.
Click to hide internal directories.