@@ -5,41 +5,45 @@ import (
55 "io"
66)
77
8- // Defines methods that a Storage Driver must implement for a filesystem-like key/value object storage
8+ // StorageDriver defines methods that a Storage Driver must implement for a filesystem-like
9+ // key/value object storage
910type StorageDriver interface {
10- // Retrieve the content stored at "path" as a []byte
11+ // GetContent retrieves the content stored at "path" as a []byte
1112 // Should primarily be used for small objects
1213 GetContent (path string ) ([]byte , error )
1314
14- // Store the []byte content at a location designated by "path"
15+ // PutContent stores the []byte content at a location designated by "path"
1516 // Should primarily be used for small objects
1617 PutContent (path string , content []byte ) error
1718
18- // Retrieve an io.ReadCloser for the content stored at "path" with a given byte offset
19+ // ReadStream retrieves an io.ReadCloser for the content stored at "path" with a given byte
20+ // offset
1921 // May be used to resume reading a stream by providing a nonzero offset
2022 ReadStream (path string , offset uint64 ) (io.ReadCloser , error )
2123
22- // Store the contents of the provided io.ReadCloser at a location designated by "path"
24+ // WriteStream stores the contents of the provided io.ReadCloser at a location designated by
25+ // the given path
2326 // The driver will know it has received the full contents when it has read "size" bytes
2427 // May be used to resume writing a stream by providing a nonzero offset
2528 // The offset must be no larger than the number of bytes already written to this path
2629 WriteStream (path string , offset , size uint64 , readCloser io.ReadCloser ) error
2730
28- // Retrieve the byte offset at which it is safe to continue writing at "path"
31+ // ResumeWritePosition retrieves the byte offset at which it is safe to continue writing at the
32+ // given path
2933 ResumeWritePosition (path string ) (uint64 , error )
3034
31- // Recursively lists the objects stored at a subpath of the given prefix
35+ // List recursively lists the objects stored at a subpath of the given prefix
3236 List (prefix string ) ([]string , error )
3337
34- // Moves an object stored at sourcePath to destPath, removing the original object
38+ // Move moves an object stored at sourcePath to destPath, removing the original object
3539 // Note: This may be no more efficient than a copy followed by a delete for many implementations
3640 Move (sourcePath string , destPath string ) error
3741
38- // Recursively deletes all objects stored at "path" and its subpaths
42+ // Delete recursively deletes all objects stored at "path" and its subpaths
3943 Delete (path string ) error
4044}
4145
42- // Error returned when operating on a nonexistent path
46+ // PathNotFoundError is returned when operating on a nonexistent path
4347type PathNotFoundError struct {
4448 Path string
4549}
@@ -48,7 +52,7 @@ func (err PathNotFoundError) Error() string {
4852 return fmt .Sprintf ("Path not found: %s" , err .Path )
4953}
5054
51- // Error returned when attempting to read or write from an invalid offset
55+ // InvalidOffsetError is returned when attempting to read or write from an invalid offset
5256type InvalidOffsetError struct {
5357 Path string
5458 Offset uint64
0 commit comments