Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultBloomFalsePositiveRate = 0.01
Variables ¶
View Source
var ErrInvalidBloomOptions = errors.New("invalid bloom options")
View Source
var ErrNotConfigured = errors.New("store not configured")
Functions ¶
Types ¶
type BloomFilter ¶
type BloomOption ¶
type BloomOption func(*BloomOptions)
func WithBloomBits ¶
func WithBloomBits(bits uint64) BloomOption
func WithBloomCapacity ¶
func WithBloomCapacity(capacity uint64) BloomOption
func WithBloomFalsePositiveRate ¶
func WithBloomFalsePositiveRate(rate float64) BloomOption
func WithBloomHashes ¶
func WithBloomHashes(hashes uint64) BloomOption
func WithBloomNamespace ¶
func WithBloomNamespace(namespace string) BloomOption
func WithBloomSeed ¶
func WithBloomSeed(seed uint64) BloomOption
type BloomOptions ¶
type BloomOptions struct {
Namespace string
Capacity uint64
FalsePositiveRate float64
Bits uint64
Hashes uint64
Seed uint64
}
func NewBloomOptions ¶
func NewBloomOptions(options ...BloomOption) BloomOptions
func (*BloomOptions) ApplyDefaults ¶
func (o *BloomOptions) ApplyDefaults()
func (BloomOptions) Validate ¶
func (o BloomOptions) Validate() error
type BloomStats ¶
type BloomStatsProvider ¶
type BloomStatsProvider interface {
Stats(ctx context.Context) (BloomStats, error)
}
type CacheAside ¶
type Option ¶
type Option func(*Options)
func WithCacheAside ¶
func WithCapacity ¶
func WithDefaultTTL ¶
func WithNamespace ¶
func WithSingleflight ¶
type Options ¶
type Options struct {
Namespace string
Capacity int
DefaultTTL time.Duration
CacheAside bool
Singleflight bool
}
func NewOptions ¶
type ResettableBloomFilter ¶
Click to show internal directories.
Click to hide internal directories.