mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-10-21 10:58:23 +00:00
New upstream version 1.5.0+ds1
This commit is contained in:
1 parent
29e4ea6ec0
commit
5c4f97f88e
324 files changed
+15360
-6668
No files matched your search
@@ -0,0 +1,34 @@
|
||||
package goleveldb
|
||||
|
||||
import (
|
||||
"github.com/syndtr/goleveldb/leveldb"
|
||||
"github.com/syndtr/goleveldb/leveldb/opt"
|
||||
|
||||
"github.com/aptly-dev/aptly/database"
|
||||
)
|
||||
|
||||
type batch struct {
|
||||
db *leveldb.DB
|
||||
b *leveldb.Batch
|
||||
}
|
||||
|
||||
func (b *batch) Put(key, value []byte) error {
|
||||
b.b.Put(key, value)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *batch) Delete(key []byte) error {
|
||||
b.b.Delete(key)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *batch) Write() error {
|
||||
return b.db.Write(b.b, &opt.WriteOptions{})
|
||||
}
|
||||
|
||||
// batch should implement database.Batch
|
||||
var (
|
||||
_ database.Batch = &batch{}
|
||||
)
|
||||
Reference in new issue
Block a user