https://github.com/applifier/go-bloomd
Bloomd client (with connection pool) for Go
https://github.com/applifier/go-bloomd
Last synced: 4 months ago
JSON representation
Bloomd client (with connection pool) for Go
- Host: GitHub
- URL: https://github.com/applifier/go-bloomd
- Owner: Applifier
- License: mit
- Created: 2018-03-08T10:03:20.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-28T13:33:53.000Z (over 7 years ago)
- Last Synced: 2024-12-30T16:02:41.882Z (over 1 year ago)
- Language: Go
- Size: 85.9 KB
- Stars: 2
- Watchers: 5
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/Applifier/go-bloomd)
[](https://coveralls.io/github/Applifier/go-bloomd?branch=master)
[](http://godoc.org/github.com/Applifier/go-bloomd)
# go-bloomd
Bloomd (https://github.com/armon/bloomd) client (with connection pool) for Go
```sh
$ go get -u github.com/Applifier/go-bloomd
```
# Example
```go
c, _ := bloomd.NewFromAddr("localhost:8673")
defer c.Close()
f, _ := c.CreateFilter(Filter{
Name: "somefilter",
})
f.Set("foobar")
found, _ := f.Check("foobar")
```
## Client pool
Client pools can be used to maintain a pool of persistent connections to bloomd server
```go
p, _ := bloomd.NewPoolFromAddr(5, 10, "localhost:8673")
c, _ := p.Get()
defer c.Close() // Return client back to pool
f, _ := c.CreateFilter(Filter{
Name: "somefilter",
})
f.Set("foobar")
found, _ := f.Check("foobar")
```