aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/storage.go19
1 files changed, 12 insertions, 7 deletions
diff --git a/core/storage.go b/core/storage.go
index add56d1..739dfb6 100644
--- a/core/storage.go
+++ b/core/storage.go
@@ -16,13 +16,6 @@ type ObjectStorage interface {
// NewObject returns a new Object, the real type of the object can be a
// custom implementation or the defaul one, MemoryObject
NewObject() Object
- // Writer retuns a writer for writing a packfile to the Storage, this method
- // is optional, if not implemented the ObjectStorage should return a
- // ErrNotImplemented error.
- //
- // If the implementation not implements Writer the objects should be written
- // using the Set method.
- Writer() (io.WriteCloser, error)
// Set save an object into the storage, the object shuld be create with
// the NewObject, method, and file if the type is not supported.
Set(Object) (Hash, error)
@@ -43,6 +36,18 @@ type ObjectStorage interface {
Begin() TxObjectStorage
}
+// ObjectStorageWrite is a optional method for ObjectStorage, it enable direct
+// write of packfile to the storage
+type ObjectStorageWrite interface {
+ // Writer retuns a writer for writing a packfile to the Storage, this method
+ // is optional, if not implemented the ObjectStorage should return a
+ // ErrNotImplemented error.
+ //
+ // If the implementation not implements Writer the objects should be written
+ // using the Set method.
+ Writer() (io.WriteCloser, error)
+}
+
// ObjectIter is a generic closable interface for iterating over objects.
type ObjectIter interface {
Next() (Object, error)