Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit d998fde

Browse files
committed
storage: filesystem iter implementation
1 parent 881bcd3 commit d998fde

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

core/storage.go

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,6 @@ type ObjectStorage interface {
1616
// NewObject returns a new Object, the real type of the object can be a
1717
// custom implementation or the defaul one, MemoryObject
1818
NewObject() Object
19-
// Writer retuns a writer for writing a packfile to the Storage, this method
20-
// is optional, if not implemented the ObjectStorage should return a
21-
// ErrNotImplemented error.
22-
//
23-
// If the implementation not implements Writer the objects should be written
24-
// using the Set method.
25-
Writer() (io.WriteCloser, error)
2619
// Set save an object into the storage, the object shuld be create with
2720
// the NewObject, method, and file if the type is not supported.
2821
Set(Object) (Hash, error)
@@ -43,6 +36,18 @@ type ObjectStorage interface {
4336
Begin() TxObjectStorage
4437
}
4538

39+
// ObjectStorageWrite is a optional method for ObjectStorage, it enable direct
40+
// write of packfile to the storage
41+
type ObjectStorageWrite interface {
42+
// Writer retuns a writer for writing a packfile to the Storage, this method
43+
// is optional, if not implemented the ObjectStorage should return a
44+
// ErrNotImplemented error.
45+
//
46+
// If the implementation not implements Writer the objects should be written
47+
// using the Set method.
48+
Writer() (io.WriteCloser, error)
49+
}
50+
4651
// ObjectIter is a generic closable interface for iterating over objects.
4752
type ObjectIter interface {
4853
Next() (Object, error)

0 commit comments

Comments
 (0)