be859e87c0
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/claude-agent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
51 lines
1.0 KiB
Go
51 lines
1.0 KiB
Go
package torrent
|
|
|
|
type TorrentInfo struct {
|
|
Hash string
|
|
Name string
|
|
Size int64
|
|
Progress float64
|
|
DlSpeed int64
|
|
UpSpeed int64
|
|
NumSeeds int32
|
|
NumLeechs int32
|
|
State string
|
|
ETA int64
|
|
Ratio float64
|
|
Category string
|
|
Tags string
|
|
AddedOn int64
|
|
CompletionOn int64
|
|
SavePath string
|
|
ContentPath string
|
|
Downloaded int64
|
|
Uploaded int64
|
|
Tracker string
|
|
SeedingTime int64
|
|
AmountLeft int64
|
|
Availability float64
|
|
}
|
|
|
|
type TorrentFile struct {
|
|
Filename string
|
|
Data []byte
|
|
}
|
|
|
|
type FindOptions struct {
|
|
Hash string
|
|
Name string
|
|
Category string
|
|
Tag string
|
|
State string
|
|
}
|
|
|
|
type TorrentClient interface {
|
|
Login(username string, password string) (string, error)
|
|
List() ([]TorrentInfo, error)
|
|
Find(opts FindOptions) ([]TorrentInfo, error)
|
|
AddTorrent(file TorrentFile, savePath string) error
|
|
AddMagnet(magnetURI string, savePath string) error
|
|
DeleteTorrent(hash string) error
|
|
DefaultSavePath() (string, error)
|
|
}
|