aboutsummaryrefslogtreecommitdiffstats
path: root/storage/transactional/object.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2018-12-10 20:18:50 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2018-12-10 20:18:50 +0100
commit12dc3ef13e5c783b9e304aa8b6a2f7097880ab87 (patch)
tree9425626a16f47f73fc7dd2128d1ea51b5d1be5a3 /storage/transactional/object.go
parenta2b39f540e5b07cf361b530e19de30707b8ca0d7 (diff)
downloadgo-git-12dc3ef13e5c783b9e304aa8b6a2f7097880ab87.tar.gz
storage: transactional, new storage with transactional capabilities
Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
Diffstat (limited to 'storage/transactional/object.go')
-rw-r--r--storage/transactional/object.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/storage/transactional/object.go b/storage/transactional/object.go
index 2a46d3c..21490b7 100644
--- a/storage/transactional/object.go
+++ b/storage/transactional/object.go
@@ -61,3 +61,15 @@ func (o *ObjectStorage) IterEncodedObjects(t plumbing.ObjectType) (storer.Encode
temporalIter,
}), nil
}
+
+func (o *ObjectStorage) Commit() error {
+ iter, err := o.temporal.IterEncodedObjects(plumbing.AnyObject)
+ if err != nil {
+ return err
+ }
+
+ return iter.ForEach(func(obj plumbing.EncodedObject) error {
+ _, err := o.EncodedObjectStorer.SetEncodedObject(obj)
+ return err
+ })
+}