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:
26
vendor/github.com/lunny/nodb/store/goleveldb/snapshot.go
generated
vendored
Normal file
26
vendor/github.com/lunny/nodb/store/goleveldb/snapshot.go
generated
vendored
Normal 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()
|
||||
}
|
Reference in New Issue
Block a user