Documentation
¶
Index ¶
Constants ¶
const ( InfoKeyName = "name" InfoKeyN = "n" InfoKeyP = "p" InfoKeyM = "m" InfoKeyK = "k" InfoKeyParts = "parts" )
InfoKeys
const (
PartBitCount uint64 = 1 << 32
)
PartBitCount the offset of bitmap in redis must smaller than 2^32 https://redis.io/commands/SETBIT
Variables ¶
var ( ErrDuplicated = errors.New("duplicated") ErrNotExists = errors.New("not exists") )
Errors
Functions ¶
This section is empty.
Types ¶
type Bloom ¶
type Bloom struct {
// contains filtered or unexported fields
}
Bloom bloomfilter class
func GetByName ¶
GetByName get bloomfilter by name client is instance of redis.Client name should be a unique key in redis instance
and it should exist before New function is called
It returns Bloom instance if no error It returns error if not exists or because of other errors such as bad network
func New ¶
New create and initialize bloomfilter client is instance of redis.Client name should be a unique key in redis instance
and it shouldn't exist before New function is called
n is estimated amount of total element that will be marked in bloomfilter p is the expected false positive rate
It returns Bloom instance if no error It returns error if duplicated or because of other errors such as bad network