Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[add] extended testing for pool creation/closing. adds NewClientFromP…
…ool and Close methods. includes example
- Loading branch information
1 parent
58880c3
commit 5a5f95c
Showing
10 changed files
with
204 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Go parameters | ||
GOCMD=go | ||
GOBUILD=$(GOCMD) build | ||
GOINSTALL=$(GOCMD) install | ||
GOCLEAN=$(GOCMD) clean | ||
GOTEST=$(GOCMD) test | ||
GOGET=$(GOCMD) get | ||
GOMOD=$(GOCMD) mod | ||
|
||
.PHONY: all test coverage | ||
all: test coverage | ||
|
||
get: | ||
$(GOGET) -t -v ./... | ||
|
||
test: get | ||
$(GOTEST) -race -covermode=atomic ./... | ||
|
||
coverage: get test | ||
$(GOTEST) -race -coverprofile=coverage.txt -covermode=atomic . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package redis_bloom_go_test | ||
|
||
import ( | ||
"fmt" | ||
redisbloom "github.com/RedisBloom/redisbloom-go" | ||
) | ||
|
||
// exemplifies the NewClient function | ||
func ExampleNewClient() { | ||
host := "localhost:6379" | ||
var client = redisbloom.NewClient(host, "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) | ||
// myItem exists in mytest: true | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters