store

package
v0.0.0-...-f752421 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BloomFilterStore

type BloomFilterStore struct {
	// contains filtered or unexported fields
}

func NewBloomFilterStore

func NewBloomFilterStore(addressHandler address.AddressHandler, opts ...Option) (*BloomFilterStore, error)

NewBloomFilterStore creates a new Bloom filter with optional file monitoring capabilities.

func NewBloomFilterStoreFromFile

func NewBloomFilterStoreFromFile(filePath string, addressHandler address.AddressHandler, opts ...Option) (*BloomFilterStore, error)

NewBloomFilterStoreFromFile creates a new Bloom filter from a file.

func (*BloomFilterStore) AddAddress

func (bf *BloomFilterStore) AddAddress(address string) error

AddAddress inserts an address into the Bloom filter and encrypts the filter.

func (*BloomFilterStore) CheckAddress

func (bf *BloomFilterStore) CheckAddress(address string) (bool, error)

CheckAddress decrypts the Bloom filter and checks if an address is in the filter.

func (*BloomFilterStore) LoadFromFile

func (bf *BloomFilterStore) LoadFromFile(filePath string) error

func (*BloomFilterStore) SaveToFile

func (bf *BloomFilterStore) SaveToFile(filePath string) error

SaveToFile saves the encrypted Bloom filter to the specified file.

type Option

type Option func(*BloomFilterStore)

Option defines a functional option for BloomFilterStore.

func WithEstimates

func WithEstimates(capacity uint, falsePositiveRate float64) Option

WithCapacity sets the capacity for the Bloom filter.

func WithSecureDataHandler

func WithSecureDataHandler(handler securedata.SecureDataHandler) Option

WithSecureDataHandler sets the SecureDataHandler for the Bloom filter.

Jump to

Keyboard shortcuts

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