Versions in this module Expand all Collapse all v1 v1.0.1 Feb 21, 2024 v1.0.0 Feb 21, 2024 Changes in this version + var ErrSizeTooLarge = errors.New("oppobloom: size given too large to round to a power of 2") + var ErrSizeTooSmall = errors.New("oppobloom: filter cannot have a zero or negative size") + var MaxFilterSize = 1 << 30 + type Filter interface + Add func(ctx context.Context, id []byte) (evicted bool) + Contains func(ctx context.Context, id []byte) bool + type LRUCacheFilter struct + func NewLRUCacheFilter(size int, scope promutils.Scope) (*LRUCacheFilter, error) + func (l LRUCacheFilter) Add(_ context.Context, id []byte) bool + func (l LRUCacheFilter) Contains(_ context.Context, id []byte) bool + type Metrics struct + Hit prometheus.Counter + Miss prometheus.Counter + type OppoBloomFilter struct + func NewOppoBloomFilter(size int, scope promutils.Scope) (*OppoBloomFilter, error) + func (f *OppoBloomFilter) Add(_ context.Context, id []byte) bool + func (f *OppoBloomFilter) Contains(_ context.Context, id []byte) bool