From ca3529bd9a6bac1a87cb47ba185c1490ab5e2836 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Sat, 26 Mar 2016 18:27:28 +1100 Subject: [PATCH] Improve doc comments on Data --- data.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- 2.48.1