2015-10-01 22:09:04 +08:00
|
|
|
package torrent
|
|
|
|
|
|
|
|
import "io"
|
|
|
|
|
|
|
|
// Represents data storage for a Torrent.
|
|
|
|
type Data interface {
|
2015-10-03 22:22:46 +08:00
|
|
|
io.ReaderAt
|
|
|
|
io.WriterAt
|
|
|
|
// Bro, do you even io.Closer?
|
2015-10-01 22:09:04 +08:00
|
|
|
Close()
|
|
|
|
// We believe the piece data will pass a hash check.
|
|
|
|
PieceCompleted(index int) error
|
|
|
|
// Returns true if the piece is complete.
|
|
|
|
PieceComplete(index int) bool
|
|
|
|
}
|