mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-28 13:49:13 -05:00
70ea2300ca
* Vendor: update gitea.com/macaron/session to a177a270 * make vendor * Vendor: update gitea.com/macaron/macaron to 0db5d458 * make vendor * Vendor: update gitea.com/macaron/cache to 905232fb * make vendor * Vendor: update gitea.com/macaron/i18n to 4ca3dd0c * make vendor * Vendor: update gitea.com/macaron/gzip to efa5e847 * make vendor * Vendor: update gitea.com/macaron/captcha to e8597820 * make vendor
42 lines
1.2 KiB
Go
Vendored
42 lines
1.2 KiB
Go
Vendored
package store
|
|
|
|
import (
|
|
"gitea.com/lunny/nodb/store/driver"
|
|
)
|
|
|
|
type Tx struct {
|
|
driver.Tx
|
|
}
|
|
|
|
func (tx *Tx) NewIterator() *Iterator {
|
|
it := new(Iterator)
|
|
it.it = tx.Tx.NewIterator()
|
|
|
|
return it
|
|
}
|
|
|
|
func (tx *Tx) NewWriteBatch() WriteBatch {
|
|
return tx.Tx.NewWriteBatch()
|
|
}
|
|
|
|
func (tx *Tx) RangeIterator(min []byte, max []byte, rangeType uint8) *RangeLimitIterator {
|
|
return NewRangeLimitIterator(tx.NewIterator(), &Range{min, max, rangeType}, &Limit{0, -1})
|
|
}
|
|
|
|
func (tx *Tx) RevRangeIterator(min []byte, max []byte, rangeType uint8) *RangeLimitIterator {
|
|
return NewRevRangeLimitIterator(tx.NewIterator(), &Range{min, max, rangeType}, &Limit{0, -1})
|
|
}
|
|
|
|
//count < 0, unlimit.
|
|
//
|
|
//offset must >= 0, if < 0, will get nothing.
|
|
func (tx *Tx) RangeLimitIterator(min []byte, max []byte, rangeType uint8, offset int, count int) *RangeLimitIterator {
|
|
return NewRangeLimitIterator(tx.NewIterator(), &Range{min, max, rangeType}, &Limit{offset, count})
|
|
}
|
|
|
|
//count < 0, unlimit.
|
|
//
|
|
//offset must >= 0, if < 0, will get nothing.
|
|
func (tx *Tx) RevRangeLimitIterator(min []byte, max []byte, rangeType uint8, offset int, count int) *RangeLimitIterator {
|
|
return NewRevRangeLimitIterator(tx.NewIterator(), &Range{min, max, rangeType}, &Limit{offset, count})
|
|
}
|