Initial aria2go implementation (#80)

This commit is contained in:
Xpl0itU 2024-01-20 12:54:18 +01:00 committed by GitHub
parent 102a734463
commit 05763bc23d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 1343 additions and 86 deletions

51
pkg/aria2go/models.go Normal file
View file

@ -0,0 +1,51 @@
// Copyright (C) 2019 Vincent Chueng (coolingfall@gmail.com).
package aria2go
// Type definition for download information.
type DownloadInfo struct {
Status int
TotalLength int64
BytesCompleted int64
BytesUpload int64
DownloadSpeed int
UploadSpeed int
NumPieces int
Connections int
BitField string
InfoHash string
MetaInfo MetaInfo
Files []File
ErrorCode int
FollowedByGid string
}
// Type definition for BitTorrent meta information.
type MetaInfo struct {
Name string
AnnounceList []string
Comment string
CreationUnix int64
Mode string
}
// Type definition for file in torrent.
type File struct {
Index int
Name string
Length int64
CompletedLength int64
Selected bool
}
type Options map[string]string
// Type definition for download event, this will keep the same with aria2.
const (
onStart = iota + 1
onPause
onStop
onComplete
onError
onBTComplete
)