1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-08 19:47:21 +00:00

add other session providers (#5963)

This commit is contained in:
techknowlogick
2019-02-05 11:52:51 -05:00
committed by GitHub
parent bf4badad1d
commit 9de871a0f8
160 changed files with 37644 additions and 66 deletions

View File

@ -0,0 +1,26 @@
package goleveldb
import (
"github.com/lunny/nodb/store/driver"
"github.com/syndtr/goleveldb/leveldb"
)
type Snapshot struct {
db *DB
snp *leveldb.Snapshot
}
func (s *Snapshot) Get(key []byte) ([]byte, error) {
return s.snp.Get(key, s.db.iteratorOpts)
}
func (s *Snapshot) NewIterator() driver.IIterator {
it := &Iterator{
s.snp.NewIterator(nil, s.db.iteratorOpts),
}
return it
}
func (s *Snapshot) Close() {
s.snp.Release()
}