+
+ // Copy a block from the backend device to writeTo.
+ //
+ // As with all volume methods, the hash argument is a
+ // 32-character hexadecimal string.
+ //
+ // Data can be written to writeTo in any order, and concurrent
+ // calls to writeTo.WriteAt() are allowed. However, BlockRead
+ // must not do multiple writes that intersect with any given
+ // byte offset.
+ //
+ // BlockRead is not expected to verify data integrity.
+ //
+ // If the indicated block does not exist, or has been trashed,
+ // BlockRead must return os.ErrNotExist.
+ BlockRead(ctx context.Context, hash string, writeTo io.WriterAt) error
+
+ // Store a block on the backend device, and set its timestamp
+ // to the current time.
+ //
+ // The implementation must ensure that regardless of any
+ // errors encountered while writing, a partially written block
+ // is not left behind: a subsequent BlockRead call must return
+ // either a) the data previously stored under the given hash,
+ // if any, or b) os.ErrNotExist.
+ BlockWrite(ctx context.Context, hash string, data []byte) error
+
+ // Update the indicated block's stored timestamp to the
+ // current time.