diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2016-09-05 07:59:20 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-09-05 07:59:20 +0200 |
commit | 65427f64599e9383ab926aed75fc02f2db32022d (patch) | |
tree | 5c81c00bc9dcfb54e0c6d0038ab2cbd8cddde389 /examples | |
parent | 440cfd96cf88ffc9d04bbd32ec8a3b1afb42144c (diff) | |
download | go-git-65427f64599e9383ab926aed75fc02f2db32022d.tar.gz |
core: ObjectStorage.Begin and TxObjectStorage
Diffstat (limited to 'examples')
-rw-r--r-- | examples/storage/aerospike/storage.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/examples/storage/aerospike/storage.go b/examples/storage/aerospike/storage.go index e77448a..b57d932 100644 --- a/examples/storage/aerospike/storage.go +++ b/examples/storage/aerospike/storage.go @@ -131,6 +131,26 @@ func (s *ObjectStorage) buildKey(h core.Hash, t core.ObjectType) (*driver.Key, e return driver.NewKey(s.ns, t.String(), fmt.Sprintf("%s|%s", s.url, h.String())) } +func (s *ObjectStorage) Begin() core.TxObjectStorage { + return &TxObjectStorage{Storage: s} +} + +type TxObjectStorage struct { + Storage *ObjectStorage +} + +func (tx *TxObjectStorage) Set(obj core.Object) (core.Hash, error) { + return tx.Storage.Set(obj) +} + +func (tx *TxObjectStorage) Commit() error { + return nil +} + +func (tx *TxObjectStorage) Rollback() error { + return nil +} + type ObjectIter struct { t core.ObjectType ch chan *driver.Record |