Documentation ¶
Overview ¶
Package bloom is a generated GoMock package.
Package bloom is a generated GoMock package.
Index ¶
- func OptimalHashFunctions(size uint, expectedElements int) uint
- func OptimalSize(expectedElements int, falsePositiveRate float64) uint
- func SaveFilterToFile(bf *Filter, filename string, logger *slog.Logger) error
- type Filter
- type MockFileOperations
- type MockFileOperationsMockRecorder
- type MockReadCloser
- type MockReadCloserMockRecorder
- type MockWriteCloser
- type MockWriteCloserMockRecorder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OptimalHashFunctions ¶
OptimalHashFunctions calculates the optimal number of hash functions for a Bloom filter
func OptimalSize ¶
OptimalSize calculates the optimal size of the Bloom filter
Types ¶
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
Filter represents a Bloom filter data structure
func LoadFilterFromFile ¶
LoadFilterFromFile loads a Bloom filter from a file
func NewBloomFilter ¶
NewBloomFilter creates a new Bloom filter with the given size and number of hash functions
func (*Filter) FalsePositiveRate ¶
FalsePositiveRate calculates the current false positive rate of the Bloom filter
type MockFileOperations ¶
type MockFileOperations struct {
// contains filtered or unexported fields
}
MockFileOperations is a mock of FileOperations interface.
func NewMockFileOperations ¶
func NewMockFileOperations(ctrl *gomock.Controller) *MockFileOperations
NewMockFileOperations creates a new mock instance.
func (*MockFileOperations) Create ¶
func (m *MockFileOperations) Create(arg0 string) (io.WriteCloser, error)
Create mocks base method.
func (*MockFileOperations) EXPECT ¶
func (m *MockFileOperations) EXPECT() *MockFileOperationsMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockFileOperations) Open ¶
func (m *MockFileOperations) Open(arg0 string) (io.ReadCloser, error)
Open mocks base method.
type MockFileOperationsMockRecorder ¶
type MockFileOperationsMockRecorder struct {
// contains filtered or unexported fields
}
MockFileOperationsMockRecorder is the mock recorder for MockFileOperations.
func (*MockFileOperationsMockRecorder) Create ¶
func (mr *MockFileOperationsMockRecorder) Create(arg0 interface{}) *gomock.Call
Create indicates an expected call of Create.
func (*MockFileOperationsMockRecorder) Open ¶
func (mr *MockFileOperationsMockRecorder) Open(arg0 interface{}) *gomock.Call
Open indicates an expected call of Open.
type MockReadCloser ¶
type MockReadCloser struct {
// contains filtered or unexported fields
}
MockReadCloser is a mock of ReadCloser interface.
func NewMockReadCloser ¶
func NewMockReadCloser(ctrl *gomock.Controller) *MockReadCloser
NewMockReadCloser creates a new mock instance.
func (*MockReadCloser) EXPECT ¶
func (m *MockReadCloser) EXPECT() *MockReadCloserMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockReadCloserMockRecorder ¶
type MockReadCloserMockRecorder struct {
// contains filtered or unexported fields
}
MockReadCloserMockRecorder is the mock recorder for MockReadCloser.
func (*MockReadCloserMockRecorder) Close ¶
func (mr *MockReadCloserMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockReadCloserMockRecorder) Read ¶
func (mr *MockReadCloserMockRecorder) Read(arg0 interface{}) *gomock.Call
Read indicates an expected call of Read.
type MockWriteCloser ¶
type MockWriteCloser struct {
// contains filtered or unexported fields
}
MockWriteCloser is a mock of WriteCloser interface.
func NewMockWriteCloser ¶
func NewMockWriteCloser(ctrl *gomock.Controller) *MockWriteCloser
NewMockWriteCloser creates a new mock instance.
func (*MockWriteCloser) EXPECT ¶
func (m *MockWriteCloser) EXPECT() *MockWriteCloserMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockWriteCloserMockRecorder ¶
type MockWriteCloserMockRecorder struct {
// contains filtered or unexported fields
}
MockWriteCloserMockRecorder is the mock recorder for MockWriteCloser.
func (*MockWriteCloserMockRecorder) Close ¶
func (mr *MockWriteCloserMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockWriteCloserMockRecorder) Write ¶
func (mr *MockWriteCloserMockRecorder) Write(arg0 interface{}) *gomock.Call
Write indicates an expected call of Write.