Sync from /srv/compose/unified-media-manager
This commit is contained in:
30
internal/download/client.go
Normal file
30
internal/download/client.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package download
|
||||
|
||||
import "context"
|
||||
|
||||
type DownloadProgress struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Status string `json:"status"`
|
||||
Progress float64 `json:"progress"`
|
||||
Speed int64 `json:"speed"`
|
||||
ETA int `json:"eta"`
|
||||
Size int64 `json:"size"`
|
||||
}
|
||||
|
||||
type CompletedDownload struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
OutputPath string `json:"output_path"`
|
||||
Size int64 `json:"size"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
|
||||
type DownloadClient interface {
|
||||
Add(ctx context.Context, url string, category string) (string, error)
|
||||
GetProgress(ctx context.Context, id string) (*DownloadProgress, error)
|
||||
GetCompleted(ctx context.Context) ([]CompletedDownload, error)
|
||||
Remove(ctx context.Context, id string) error
|
||||
Pause(ctx context.Context, id string) error
|
||||
Resume(ctx context.Context, id string) error
|
||||
}
|
||||
Reference in New Issue
Block a user