Skip to content

Commit a7891f5

Browse files
authored
Merge pull request #3 from wangthomas/add_client_dir
naming fix
2 parents b8852df + 3c067b7 commit a7891f5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

client/client.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package client
33
import (
44

55
"context"
6+
"time"
67

78
"google.golang.org/grpc"
89

@@ -53,7 +54,7 @@ func (t *bloomClient) Create(ctx context.Context, filter string) error {
5354
// Add issues a command to add a specified key to a given filter
5455
func (t *bloomClient) Add(ctx context.Context, filter string, hashes []uint64) error {
5556
req := &pb.KeyRequest{
56-
Name: filter,
57+
FilterName: filter,
5758
Hashes: hashes,
5859
}
5960

@@ -66,14 +67,14 @@ func (t *bloomClient) Add(ctx context.Context, filter string, hashes []uint64) e
6667
// Has checks if a given key exists in a specified filter
6768
func (t *bloomClient) Has(ctx context.Context, filter string, hashes []uint64) (bool, error) {
6869
req := &pb.KeyRequest{
69-
Name: filter,
70+
FilterName: filter,
7071
Hashes: hashes,
7172
}
7273

7374
timedCtx, cancel := context.WithTimeout(ctx, t.timeout)
7475
defer cancel()
7576
resp, err := t.client.Has(timedCtx, req)
76-
var has []bool
77+
var has bool
7778
if resp != nil {
7879
has = resp.Has
7980
}
@@ -87,7 +88,7 @@ func (t *bloomClient) Drop(ctx context.Context, filter string) error {
8788

8889
timedCtx, cancel := context.WithTimeout(context.Background(), t.timeout)
8990
defer cancel()
90-
_, err := t.client.Drop(timedCtx, req)
91+
_, err := t.client.DropFilter(timedCtx, req)
9192
return err
9293
}
9394

0 commit comments

Comments
 (0)