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 ¶
WithCapacity sets the capacity for the Bloom filter.
func WithSecureDataHandler ¶
func WithSecureDataHandler(handler securedata.SecureDataHandler) Option
WithSecureDataHandler sets the SecureDataHandler for the Bloom filter.
Click to show internal directories.
Click to hide internal directories.