mirror of
https://github.com/go-gitea/gitea.git
synced 2024-08-27 14:47:27 +02:00
32 lines
687 B
Go
32 lines
687 B
Go
|
// Copyright (c) 2012, Suryandaru Triandana <syndtr@gmail.com>
|
||
|
// All rights reserved.
|
||
|
//
|
||
|
// Use of this source code is governed by a BSD-style license that can be
|
||
|
// found in the LICENSE file.
|
||
|
|
||
|
package leveldb
|
||
|
|
||
|
import (
|
||
|
"github.com/syndtr/goleveldb/leveldb/filter"
|
||
|
)
|
||
|
|
||
|
type iFilter struct {
|
||
|
filter.Filter
|
||
|
}
|
||
|
|
||
|
func (f iFilter) Contains(filter, key []byte) bool {
|
||
|
return f.Filter.Contains(filter, internalKey(key).ukey())
|
||
|
}
|
||
|
|
||
|
func (f iFilter) NewGenerator() filter.FilterGenerator {
|
||
|
return iFilterGenerator{f.Filter.NewGenerator()}
|
||
|
}
|
||
|
|
||
|
type iFilterGenerator struct {
|
||
|
filter.FilterGenerator
|
||
|
}
|
||
|
|
||
|
func (g iFilterGenerator) Add(key []byte) {
|
||
|
g.FilterGenerator.Add(internalKey(key).ukey())
|
||
|
}
|