Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BloomFilter ¶ added in v0.2.0
type BloomFilter struct {
// contains filtered or unexported fields
}
BloomFilter represents a bloom filter with a fixed number of bits and hash functions.
func NewBloomFilter ¶
func NewBloomFilter(expectedItems uint64, falsePositiveRate float64) (r *BloomFilter)
NewBloomFilter creates a new bloom filter with the specified size, hash function count, and capacity.
func (*BloomFilter) Add ¶ added in v0.2.0
func (bf *BloomFilter) Add(item []byte)
Add adds an item (as byte slice) to the bloom filter using multiple hash functions.
func (*BloomFilter) Contains ¶ added in v0.2.0
func (bf *BloomFilter) Contains(item []byte) bool
Contains if an item (as byte slice) is possibly in the bloom filter.
func (*BloomFilter) String ¶ added in v0.2.0
func (bf *BloomFilter) String() string
type LruCache ¶
type LruCache[T any] struct { // contains filtered or unexported fields }
func NewLruCache ¶
func (*LruCache[T]) Remove ¶
Remove deletes an entry from the cache. It uses Lock for exclusive writes.
func (*LruCache[T]) RemoveMulti ¶
RemoveMulti deletes multiple entries from the cache. It uses Lock for exclusive writes.
Click to show internal directories.
Click to hide internal directories.