feat: 命令行工具

This commit is contained in:
liwei committed 2021-03-23 19:03:46 +08:00
1 parent f150ec23c4
commit 046729bfaa
10 files changed
+195 -31

No files matched your search

+12
View File
@@ -142,3 +142,15 @@ func (d *DialerWarp) Dial(network, addr string) (c net.Conn, err error) {
}
return &ConnWarp{conn: conn}, nil
}
// 获取任务中各个文件的已下载字节数
type Progress []int64
// TotalDownloaded 获取任务总下载字节数
func (p Progress) TotalDownloaded() int64 {
total := int64(0)
for _, d := range p {
total += d
}
return total
}