Coder Social home page Coder Social logo

yianz / redisbloom-go Goto Github PK

View Code? Open in Web Editor NEW

This project forked from redisbloom/redisbloom-go

0.0 0.0 0.0 59 KB

Go Client for RedisBloom probabilistic module

Home Page: https://redisbloom.io

License: BSD 3-Clause "New" or "Revised" License

Go 98.27% Makefile 1.73%

redisbloom-go's Introduction

license CircleCI GitHub issues Codecov GoDoc Go Report Card

redisbloom-go

Forum Discord

Go client for RedisBloom (https://github.com/RedisBloom/redisbloom), based on redigo.

Installing

$ go get github.com/RedisBloom/redisbloom-go

Running tests

A simple test suite is provided, and can be run with:

$ go test

The tests expect a Redis server with the RedisBloom module loaded to be available at localhost:6379. You can easily launch RedisBloom with Docker in the following manner:

docker run -d -p 6379:6379 --name redis-redisbloom redislabs/rebloom:latest 

Example Code

Make sure to check the full list of examples at Pkg.go.dev.

package main 

import (
        "fmt"
        redisbloom "github.com/RedisBloom/redisbloom-go"
)

func main() {
		// Connect to localhost with no password
    var client = redisbloom.NewClient("localhost:6379", "nohelp", nil)
       
    // BF.ADD mytest item 
    _, err := client.Add("mytest", "myItem")
    if err != nil {
        fmt.Println("Error:", err)
    }
    
    exists, err := client.Exists("mytest", "myItem")
    if err != nil {
        fmt.Println("Error:", err)
    }
    fmt.Println("myItem exists in mytest: ", exists)
}

Supported RedisBloom Commands

Make sure to check the full command reference at redisbloom.io.

Bloom Filter

Command Recommended API and godoc
BF.RESERVE Reserve
BF.ADD Add
BF.MADD BfAddMulti
BF.INSERT BfInsert
BF.EXISTS Exists
BF.MEXISTS BfExistsMulti
BF.SCANDUMP BfScanDump
BF.LOADCHUNK BfLoadChunk
BF.INFO Info

Cuckoo Filter

Command Recommended API and godoc
CF.RESERVE CfReserve
CF.ADD CfAdd
CF.ADDNX CfAddNx
CF.INSERT CfInsert
CF.INSERTNX CfInsertNx
CF.EXISTS CfExists
CF.DEL CfDel
CF.COUNT CfCount
CF.SCANDUMP CfScanDump
CF.LOADCHUNK CfLoadChunk
CF.INFO CfInfo

Count-Min Sketch

Command Recommended API and godoc
CMS.INITBYDIM CmsInitByDim
CMS.INITBYPROB CmsInitByProb
CMS.INCRBY CmsIncrBy
CMS.QUERY CmsQuery
CMS.MERGE CmsMerge
CMS.INFO CmsInfo

TopK Filter

Command Recommended API and godoc
TOPK.RESERVE TopkReserve
TOPK.ADD TopkAdd
TOPK.INCRBY TopkIncrby
TOPK.QUERY TopkQuery
TOPK.COUNT TopkCount
TOPK.LIST TopkList
TOPK.INFO TopkInfo

License

redisbloom-go is distributed under the BSD 3-Clause license - see LICENSE

redisbloom-go's People

Contributors

filipecosta90 avatar dengliming avatar gkorland avatar ashtul avatar razitz 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.