Documentation
¶
Index ¶
Constants ¶
View Source
const FORMAT = " %-10s %-10s %-16s %s\n"
Client, Status, TaskId, Note
View Source
const NAME_WIDTH = 30
Variables ¶
This section is empty.
Functions ¶
func PrintResourceDownloads ¶
func PrintResourceDownloads(output io.Writer, title string, resourceDownloads []*ResourceDownload)
Types ¶
type Download ¶
type Download struct {
ID uint `gorm:"primarykey" json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DownloadId string `json:"download_id"` // download task id in client
FileId string `json:"file_id"`
Identifier string `json:"identifier"`
Site string `json:"site"`
FileUrl string `json:"file_url"`
Filename string `json:"filename"`
SavePath string `json:"save_path"`
ResourceId string `json:"resource_id"`
Status string `json:"status"` // (empty)|downloading|completed|error
Note string `json:"note"`
Client string `json:"client"`
}
a download task in client. For convenience, it implements client.DownloadTask.
func (*Download) GetFilename ¶
func (*Download) GetSavePath ¶
type ResourceDownload ¶
type ResourceDownload struct {
ID uint `gorm:"primarykey" json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ResourceId string `json:"resource_id"`
Identifier string `json:"identifier"`
Site string `json:"site"`
Status string `json:"status"`
Size int64 `json:"size"`
Number string `json:"number"`
Title string `json:"title"`
Author string `json:"author"`
Client string `json:"client"`
SavePath string `json:"save_path"`
Note string `json:"note"`
Failed int `json:"failed"` // failed times count
Tags Tags `gorm:"type:string" json:"tags"`
}
Do NOT embed gorm.Model as we need to set json tag
func (*ResourceDownload) GetFilename ¶
func (r *ResourceDownload) GetFilename() (filename string)
Return suitable folder name
type Tags ¶
type Tags []string
Custom sql type. A custom sql type T must implements Valuer and *T must implements Scanner
func (Tags) GetMetaArray ¶
Click to show internal directories.
Click to hide internal directories.