blob: 67f6ca13dac147468290e9d6950b3f7d8ee54a98 [file] [log] [blame]
Giorgi Lekveishvili45b4d522020-03-19 21:11:18 +04001package chunk
2
giolekva1f6577a2020-03-25 12:53:06 +04003import (
4 "io"
5
giolekvad2a029d2020-03-25 23:06:08 +04006 "github.com/giolekva/pcloud/api"
giolekva1f6577a2020-03-25 12:53:06 +04007)
8
9type ChunkInfo struct {
10 Status api.ChunkStatus
11 Size int
12 Committed int
13}
Giorgi Lekveishvili45b4d522020-03-19 21:11:18 +040014
15type Chunk interface {
giolekva1f6577a2020-03-25 12:53:06 +040016 Stats() (ChunkInfo, error)
17 ReaderAt() io.ReaderAt
18 WriterAt() io.WriterAt
Giorgi Lekveishvili45b4d522020-03-19 21:11:18 +040019}
20
giolekva7be17df2020-03-21 13:57:02 +040021type ChunkFactory interface {
giolekva1f6577a2020-03-25 12:53:06 +040022 New(size int) Chunk
Giorgi Lekveishvili45b4d522020-03-19 21:11:18 +040023}