Documentation ¶
Overview ¶
Package bloomfilter contains common data and interfaces needed to implement bloomfilters.
It is based on the theory explained in: http://llimllib.github.io/bloomfilter-tutorial/ In the repo, there are created the following types of bloomfilter: derived from bitset, sliding bloomfilters and rpc bloomfilter implementation.
Index ¶
Constants ¶
View Source
const ( HASHER_DEFAULT = "default" HASHER_OPTIMAL = "optimal" )
Variables ¶
View Source
var ( HashFactoryNames = map[string]HashFactory{ HASHER_DEFAULT: DefaultHashFactory, HASHER_OPTIMAL: OptimalHashFactory, } ErrImpossibleToTreat = fmt.Errorf("unable to union") MD5 = HashWrapper(md5.New()) SHA1 = HashWrapper(sha1.New()) CRC64 = HashWrapper(crc64.New(crc64.MakeTable(crc64.ECMA))) FNV64 = HashWrapper(fnv.New64()) FNV128 = HashWrapper(fnv.New128()) )
View Source
var EmptyConfig = Config{
N: 2,
P: .5,
}
EmptyConfig configuration used for first empty `previous` bloomfilter in the sliding three bloomfilters
Functions ¶
Types ¶
type Bloomfilter ¶
Bloomfilter interface implemented in the different packages
type Config ¶
Config for bloomfilter defining the parameters: P - desired false positive probability, N - number of elements to be stored in the filter and HashName - the name of the particular hashfunction
type HashFactory ¶
Directories ¶
Path | Synopsis |
---|---|
Package bitset implements a bitset based on the bitset library.
|
Package bitset implements a bitset based on the bitset library. |
Package bbloomfilter implements a bloomfilter based on an m-bit bit array, k hashfilters and configuration.
|
Package bbloomfilter implements a bloomfilter based on an m-bit bit array, k hashfilters and configuration. |
cmd
|
|
client
Client application that reads from keyboard add and checks operations with data to store to a bloomfilter by means of an rpc until pressing ctrl-c.
|
Client application that reads from keyboard add and checks operations with data to store to a bloomfilter by means of an rpc until pressing ctrl-c. |
server
Server application that registers a bloomfilter by means of an rpc.
|
Server application that registers a bloomfilter by means of an rpc. |
Package krakend registers a bloomfilter given a config and registers the service with consul.
|
Package krakend registers a bloomfilter given a config and registers the service with consul. |
Package rotate implemennts a sliding set of three bloomfilters: `previous`, `current` and `next` and the bloomfilter interface.
|
Package rotate implemennts a sliding set of three bloomfilters: `previous`, `current` and `next` and the bloomfilter interface. |
Package rpc implements the rpc layer for the bloomfilter, following the principles from https://golang.org/pkg/net/rpc
|
Package rpc implements the rpc layer for the bloomfilter, following the principles from https://golang.org/pkg/net/rpc |
client
Package client implements an rpc client for the bloomfilter, along with Add and Check methods.
|
Package client implements an rpc client for the bloomfilter, along with Add and Check methods. |
server
Package server implements an rpc server for the bloomfilter, registering a bloomfilter and accepting a tcp listener.
|
Package server implements an rpc server for the bloomfilter, registering a bloomfilter and accepting a tcp listener. |
Package testutils contains utils for the tests.
|
Package testutils contains utils for the tests. |
Click to show internal directories.
Click to hide internal directories.