Code Monkey home page Code Monkey logo

blass's Introduction

blass

Bloom filters as a service.

Instructions

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.

API

Create bloom filter

Endpoint: POST /v1/filters

Parameters:

  • name, the name you gonna use to create and check for entries, ex: spammers
  • capacity, how many records do you plan to insert on bloom filter, ex: 100000
  • errorRate, the chance of the filter making a mistake when checking for an entry, ex: 0.01 (1%)

Returns:

  • 201 Created, filter was created
  • 409 Conflict, filter already exists

Retrieve bloom filter information

Endpoint: GET /v1/filters/{filterName}

Parameters:

  • filterName (on URL), the name you used to create the filter

Returns:

  • 200 OK, filter was found, JSON with capacity and errorRate
  • 404 Not Found, filter not found

Delete bloom filter

Endpoint: DELETE /v1/filters/{filterName}

Parameters:

  • filterName (on URL), the name you used to create the filter

Returns:

  • 204 No Content, filter was deleted
  • 404 Not Found, filter not found

Create entry on bloom filter

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 created
  • 400 Bad Request, filter not found

Check entry existence on bloom filter

Parameters: GET /v1/filters/{filterName}/entries/{entryName}

  • filterName (on URL), the name you used to create the filter
  • entryName (on URL), the name you use to create the entry on the bloom filter

Returns:

  • 200 OK, entry exists
  • 404 Not found, entry not found
  • 400 Bad Request, filter not found

blass's People

Contributors

cabello avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.