]> Sergey Matveev's repositories - btrtrc.git/blobdiff - storage/interface.go
Fix UseSources panicking when sqlite storage is closed
[btrtrc.git] / storage / interface.go
index ee6e6336cdb8e7bf6ccb08f31e2aa07dd6a97210..9e8de06c8f55313370e938d386f234f45b22e3d3 100644 (file)
@@ -22,6 +22,7 @@ type TorrentCapacity *func() (cap int64, capped bool)
 type TorrentImpl struct {
        Piece func(p metainfo.Piece) PieceImpl
        Close func() error
+       Flush func() error
        // Storages that share the same space, will provide equal pointers. The function is called once
        // to determine the storage for torrents sharing the same function pointer, and mutated in
        // place.
@@ -29,8 +30,9 @@ type TorrentImpl struct {
 }
 
 // Interacts with torrent piece data. Optional interfaces to implement include:
-//   io.WriterTo, such as when a piece supports a more efficient way to write out incomplete chunks.
-//   SelfHashing, such as when a piece supports a more efficient way to hash its contents.
+//
+//     io.WriterTo, such as when a piece supports a more efficient way to write out incomplete chunks.
+//     SelfHashing, such as when a piece supports a more efficient way to hash its contents.
 type PieceImpl interface {
        // These interfaces are not as strict as normally required. They can
        // assume that the parameters are appropriate for the dimensions of the
@@ -49,6 +51,7 @@ type PieceImpl interface {
 type Completion struct {
        Complete bool
        Ok       bool
+       Err      error
 }
 
 // Allows a storage backend to override hashing (i.e. if it can do it more efficiently than the torrent client can)