]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Improve doc comments on Data
authorMatt Joiner <anacrolix@gmail.com>
Sat, 26 Mar 2016 07:27:28 +0000 (18:27 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Sat, 26 Mar 2016 07:27:28 +0000 (18:27 +1100)
data.go

diff --git a/data.go b/data.go
index c64069dd55bb51ca85a3db69e7a074c20ceb6ee8..dec2e847ee4b3e7ba5505a070790b5c9fafad17b 100644 (file)
--- 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