add cache

This commit is contained in:
YouROK
2020-12-07 15:55:54 +03:00
parent 30604c6e94
commit a5c1d5b4de
7 changed files with 142 additions and 8 deletions

View File

@@ -0,0 +1,18 @@
package state
type CacheState struct {
Hash string
Capacity int64
Filled int64
PiecesLength int64
PiecesCount int
DownloadSpeed float64
Pieces map[int]ItemState
}
type ItemState struct {
Id int
Length int64
Size int64
Completed bool
}