filter

package
v0.0.0-...-81f4bad Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: ISC Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToBytes

func ConvertToBytes(value interface{}) ([]byte, error)

func GenerateUniqueBloomName

func GenerateUniqueBloomName() string

Types

type BloomFilter

type BloomFilter struct {
	Name string
	Size uint64
	// contains filtered or unexported fields
}

func New

func New(opts *Opts) *BloomFilter

New creates a new Bloom filter with the specified size and number of hash functions.

func (*BloomFilter) Add

func (bf *BloomFilter) Add(key []byte)

Add adds a key to the Bloom filter.

func (*BloomFilter) Clear

func (bf *BloomFilter) Clear()

func (*BloomFilter) Has

func (bf *BloomFilter) Has(key []byte) bool

Has tests whether a key is in the Bloom filter.

func (*BloomFilter) Load

func (bf *BloomFilter) Load() error

func (*BloomFilter) Save

func (bf *BloomFilter) Save() error

Save saves the Bloom filter to a file.

type Opts

type Opts struct {
	Size uint64
	Path string
}

Jump to

Keyboard shortcuts

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