Documentation ¶
Index ¶
- Variables
- type Bloom
- func (bl *Bloom) Add(entry []byte)
- func (bl *Bloom) AddIfNotHas(entry []byte) (added bool)
- func (bl *Bloom) AddIfNotHasTS(entry []byte) (added bool)
- func (bl *Bloom) AddTS(entry []byte)
- func (bl *Bloom) Clear()
- func (bl *Bloom) ElementsAdded() uint64
- func (bl *Bloom) FillRatio() float64
- func (bl *Bloom) Has(entry []byte) bool
- func (bl *Bloom) HasTS(entry []byte) bool
- func (bl *Bloom) JSONMarshal() ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidParms = errors.New("One of parameters was outside of allowed range")
var ErrUsage = errors.New("usage: New(float64(number_of_entries), float64(number_of_hashlocations)) i.e. New(float64(1000), float64(3)) or New(float64(number_of_entries), float64(ratio_of_false_positives)) i.e. New(float64(1000), float64(0.03))")
Functions ¶
This section is empty.
Types ¶
type Bloom ¶
Bloom filter
func JSONUnmarshal ¶
JSONUnmarshal takes JSON-Object (type bloomJSONImExport) as []bytes returns bloom32 / bloom64 object
func NewWithBoolset ¶
NewWithBoolset takes a []byte slice and number of locs per entry returns the bloomfilter with a bitset populated according to the input []byte
func (*Bloom) AddIfNotHas ¶
AddIfNotHas Only Add entry if it's not present in the bloomfilter returns true if entry was added returns false if entry was allready registered in the bloomfilter
func (*Bloom) AddIfNotHasTS ¶
AddIfNotHasTS Tread safe: Only Add entry if it's not present in the bloomfilter returns true if entry was added returns false if entry was allready registered in the bloomfilter
func (*Bloom) AddTS ¶
AddTS Thread safe: Mutex.Lock the bloomfilter for the time of processing the entry
func (*Bloom) ElementsAdded ¶
func (*Bloom) Has ¶
Has check if bit(s) for entry is/are set returns true if the entry was added to the Bloom Filter
func (*Bloom) HasTS ¶
HasTS Thread safe: Mutex.Lock the bloomfilter for the time of processing the entry
func (*Bloom) JSONMarshal ¶
JSONMarshal returns JSON-object (type bloomJSONImExport) as []byte