Bloom filters as a service.
It's simple: clone, set the GOPATH and run the service.
$ go get github.com/cabello/blass
$ cd $GOPATH/src/github.com/cabello/blass
$ go run server/server.go
The filters you create and the entries you add will be held on memory.
Endpoint: POST /v1/filters
Parameters:
name
, the name you gonna use to create and check for entries, ex: spammerscapacity
, how many records do you plan to insert on bloom filter, ex: 100000errorRate
, the chance of the filter making a mistake when checking for an entry, ex: 0.01 (1%)
Returns:
201 Created
, filter was created409 Conflict
, filter already exists
Endpoint: GET /v1/filters/{filterName}
Parameters:
filterName
(on URL), the name you used to create the filter
Returns:
200 OK
, filter was found, JSON withcapacity
anderrorRate
404 Not Found
, filter not found
Endpoint: DELETE /v1/filters/{filterName}
Parameters:
filterName
(on URL), the name you used to create the filter
Returns:
204 No Content
, filter was deleted404 Not Found
, filter not found
Endpoint: POST /v1/filters/{filterName}/entries
Parameters:
name
, the name you gonna use to check if the entry is on your bloom filter
Returns:
201 Created
, entry was created400 Bad Request
, filter not found
Parameters: GET /v1/filters/{filterName}/entries/{entryName}
filterName
(on URL), the name you used to create the filterentryName
(on URL), the name you use to create the entry on the bloom filter
Returns:
200 OK
, entry exists404 Not found
, entry not found400 Bad Request
, filter not found