aboutsummaryrefslogtreecommitdiffstats
path: root/storage/memory/storage.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-08-11 18:07:29 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-08-11 18:07:29 +0200
commit1f64d789038594098ea2c9cf796391f101d0bea5 (patch)
tree50fb530fc2e48560e70489dc81758f54822dcf50 /storage/memory/storage.go
parentc1e277a7ca75ff84741d75ad45e29a2ff3e633e3 (diff)
downloadgo-git-1f64d789038594098ea2c9cf796391f101d0bea5.tar.gz
core: new MemoryObject, move from memory.Object, packfile.Parser, base on new ObjectStorage interface
Diffstat (limited to 'storage/memory/storage.go')
-rw-r--r--storage/memory/storage.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/storage/memory/storage.go b/storage/memory/storage.go
index 62fd1b4..c827ce0 100644
--- a/storage/memory/storage.go
+++ b/storage/memory/storage.go
@@ -28,6 +28,11 @@ func NewObjectStorage() *ObjectStorage {
}
}
+// NewObject creates a new MemoryObject
+func (o *ObjectStorage) NewObject() core.Object {
+ return &core.MemoryObject{}
+}
+
// Set stores an object, the object should be properly filled before set it.
func (o *ObjectStorage) Set(obj core.Object) (core.Hash, error) {
h := obj.Hash()