added preload status and cancel
This commit is contained in:
parent
0c9fb06263
commit
a069baf48d
10 changed files with 153 additions and 35 deletions
|
|
@ -30,6 +30,13 @@ func (cs *Chunks) Add(off int64, n int) {
|
|||
cs.merge()
|
||||
}
|
||||
|
||||
func (cs Chunks) Size() (sum int64) {
|
||||
for _, c := range cs {
|
||||
sum += (c[1] - c[0])
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (cs *Chunks) merge() {
|
||||
c := *cs
|
||||
if len(c) < 2 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue