6 "github.com/anacrolix/torrent/metainfo"
9 // Represents data storage for an unspecified torrent.
10 type Client interface {
11 OpenTorrent(info *metainfo.Info, infoHash metainfo.Hash) (Torrent, error)
14 // Data storage bound to a torrent.
15 type Torrent interface {
16 Piece(metainfo.Piece) Piece
20 // Interacts with torrent piece data.
21 type Piece interface {
22 // Should return io.EOF only at end of torrent. Short reads due to missing
23 // data should return io.ErrUnexpectedEOF.
26 // Called when the client believes the piece data will pass a hash check.
27 // The storage can move or mark the piece data as read-only as it sees
30 // Returns true if the piece is complete.