filters

package
v0.0.0-...-dcabc21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2025 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bloom

type Bloom[T any] struct {
	// contains filtered or unexported fields
}

func NewBloomFilter

func NewBloomFilter[T any](ctx context.Context, builder Builder[T]) (*Bloom[T], error)

func (*Bloom[T]) Add

func (b *Bloom[T]) Add(keys [][]byte)

func (*Bloom[T]) Has

func (b *Bloom[T]) Has(key string) bool

func (*Bloom[T]) Refresh

func (b *Bloom[T]) Refresh(ctx context.Context) error

type Builder

type Builder[T any] interface {
	Build([]T) [][]byte
	Fetch(context.Context) ([]T, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL