@@ -16,13 +16,6 @@ type ObjectStorage interface {
16
16
// NewObject returns a new Object, the real type of the object can be a
17
17
// custom implementation or the defaul one, MemoryObject
18
18
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 )
26
19
// Set save an object into the storage, the object shuld be create with
27
20
// the NewObject, method, and file if the type is not supported.
28
21
Set (Object ) (Hash , error )
@@ -43,6 +36,18 @@ type ObjectStorage interface {
43
36
Begin () TxObjectStorage
44
37
}
45
38
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
+
46
51
// ObjectIter is a generic closable interface for iterating over objects.
47
52
type ObjectIter interface {
48
53
Next () (Object , error )
0 commit comments