Documentation ¶
Overview ¶
A simple and high-performance Bloom filter written in golang.
import bloomfilter "github.com/alovn/go-bloomfilter"
MemoryBloomFilter:
bloom := bloomfilter.NewMemoryBloomFilter(10000) bs := []byte("bloom") _ = bloom.Put(bs) exists, err := bloom.MightContain(bs)
RedisBloomFilter:
cli := redis.NewClient(&redis.Options{ Addr: "127.0.0.1:6379", Password: "", DB: 0, }) key := "redis bloomfilter" bloom := bloomfilter.NewRedisBloomFilter(cli, "test", 1000000) bs := []byte(key) _ = bloom.Put(bs) exists, err := bloom.MightContain(bs)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BloomFilter ¶
BloomFilter interface define
func NewMemoryBloomFilter ¶
func NewMemoryBloomFilter(size uint64) BloomFilter
NewMemoryBloomFilter implementation with memory
func NewRedisBloomFilter ¶ added in v1.0.1
func NewRedisBloomFilter(redisCli RedisClient, redisKey string, size uint64) BloomFilter
type RedisClient ¶ added in v1.1.0
type RedisClient interface {
Pipeline() redis.Pipeliner
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.