Documentation ¶
Index ¶
Constants ¶
View Source
const ( // FalsePositive is the fixed false positive rate parameter for the bloomfilter, // expressed in terms of 0-1 is 0% - 100% FalsePositive = 1e-6 BloomfilterTypeBitsAndBloom = iota )
Variables ¶
View Source
var ErrReadingBloomfilter = fmt.Errorf("could not read a bloomfilter structure from the remote end")
ErrReadingBloomfilter is triggered if there's an IO problem reading the remote side bloomfilter structure
Functions ¶
func NewBloomfilter ¶
func NewBloomfilter(t Bloomfilter, n int64) (bloomfilter, error)
NewBloomfilter instantiates a bloomfilter with the given type and number of items to be inserted.
Types ¶
type Bloomfilter ¶
type Bloomfilter int
var BloomfilterBitsAndBloom Bloomfilter = BloomfilterTypeBitsAndBloom
type Receiver ¶
type Receiver struct {
// contains filtered or unexported fields
}
Receiver side of the BPSI protocol
func NewReceiver ¶
func NewReceiver(rw io.ReadWriter) *Receiver
NewReceiver returns a bloomfilter receiver initialized to use rw as the communication layer
func (*Receiver) Intersect ¶
func (r *Receiver) Intersect(ctx context.Context, n int64, identifiers <-chan []byte) (intersection [][]byte, err error)
Intersect on matchables read from the identifiers channel, returning the matching intersection, using the NPSI protocol. The format of an indentifier is
string
type Sender ¶
type Sender struct {
// contains filtered or unexported fields
}
Sender side of the BPSI protocol
func NewSender ¶
func NewSender(rw io.ReadWriter) *Sender
NewSender returns a bloomfilter sender initialized to use rw as the communication layer
Click to show internal directories.
Click to hide internal directories.