Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTooLargeOffset = errors.New("too large offset")
Functions ¶
This section is empty.
Types ¶
type BitSetProvider ¶
type BitSetProvider interface {
// contains filtered or unexported methods
}
type BloomFilter ¶
type BloomFilter struct {
// contains filtered or unexported fields
}
func New ¶
func New(store *redis.Redis, key string, bits uint) *BloomFilter
New create a BloomFilter, store is the backed redis, key is the key for the bloom filter, bits is how many bits will be used, maps is how many hashes for each addition. best practices: elements - means how many actual elements when maps = 14, formula: 0.7*(bits/maps), bits = 20*elements, the error rate is 0.000067 < 1e-4 for detailed error rate table, see http://pages.cs.wisc.edu/~cao/papers/summary-cache/node8.html
func (*BloomFilter) Add ¶
func (f *BloomFilter) Add(data []byte) error
Click to show internal directories.
Click to hide internal directories.