From: Matt Joiner Date: Sat, 26 Mar 2016 07:27:28 +0000 (+1100) Subject: Improve doc comments on Data X-Git-Tag: v1.0.0~818 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=ca3529bd9a6bac1a87cb47ba185c1490ab5e2836;p=btrtrc.git Improve doc comments on Data --- diff --git a/data.go b/data.go index c64069dd..dec2e847 100644 --- a/data.go +++ b/data.go @@ -4,11 +4,15 @@ import "io" // Represents data storage for a Torrent. type Data interface { + // Should return io.EOF only at end of torrent. Short reads due to missing + // data should return io.ErrUnexpectedEOF. io.ReaderAt io.WriterAt // Bro, do you even io.Closer? Close() - // We believe the piece data will pass a hash check. + // Called when the client believes the piece data will pass a hash check. + // The storage can move or mark the piece data as read-only as it sees + // fit. PieceCompleted(index int) error // Returns true if the piece is complete. PieceComplete(index int) bool