Documentation ¶
Index ¶
- func CreateMagent(ctx context.Context, url string) (int32, error)
- func CreateTask(ctx context.Context, p *TaskParam) (int32, error)
- func CreateTorrent(ctx context.Context, p TorrentParam) (int32, error)
- func DeleteMagnetByID(ctx context.Context, id int) error
- func DeleteTaskByID(ctx context.Context, id int) error
- func GetTorrentByMd5(ctx context.Context, md5 string) (*codegen.Torrent, error)
- func Init(ctx context.Context, url string) (func(), error)
- func SetTaskTotalBytes(ctx context.Context, id int, total int64) error
- func UpdateTaskDownloadedBytes(ctx context.Context, id int, downloadBytes int64) error
- func UpdateTaskStatus(ctx context.Context, id int, status string) error
- type DownloadInfo
- type TaskParam
- type TaskResp
- type TorrentParam
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateMagent ¶
CreateMagent ...
func CreateTorrent ¶
func CreateTorrent(ctx context.Context, p TorrentParam) (int32, error)
CreateTorrent ...
func DeleteMagnetByID ¶
DeleteMagnetByID ...
func GetTorrentByMd5 ¶
GetTorrentByMd5 ...
func SetTaskTotalBytes ¶
SetTaskTotalBytes ...
func UpdateTaskDownloadedBytes ¶
UpdateTaskDownloadedBytes ...
Types ¶
type DownloadInfo ¶
func FilterDowloadInfos ¶
func FilterDowloadInfos(ctx context.Context, status string) ([]DownloadInfo, error)
FilterDownloadInfos by status
func GetDownloadInfo ¶
func GetDownloadInfo(ctx context.Context, id int) (*DownloadInfo, error)
type TaskParam ¶
type TaskParam struct { Name string `json:"name"` TID int `json:"tid,omitempty"` MURL string `json:"magnet_url,omitempty"` Dir string `json:"destination"` }
TaskParam ...
type TaskResp ¶
type TaskResp struct { ID int32 `json:"id"` Name string `json:"name"` MagnetID int32 `json:"magnet_id"` Directory string `json:"directory"` TotalBytes int64 `json:"total_bytes"` DownloadBytes int64 `json:"download_bytes"` Status string `json:"status"` CreatedAt time.Time `json:"create_at"` UpdatedAt time.Time `json:"update_at"` }
TaskResp ...
Click to show internal directories.
Click to hide internal directories.