File tree Expand file tree Collapse file tree 1 file changed +8
-15
lines changed
Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -32,25 +32,18 @@ package main
3232
3333import (
3434 " fmt"
35- RedisBloom " github.com/RedisBloom/redisbloom-go"
35+ redisbloom " github.com/RedisBloom/redisbloom-go"
3636)
3737
3838func main () {
3939 // Connect to localhost with no password
40- var client = RedisBloom.NewClient (" localhost:6379" , " nohelp" , nil )
41- var keyname = " mytest"
42- _ , haveit := client.Info (keyname)
43- if haveit != nil {
44- client.CreateKeyWithOptions (keyname, RedisBloom.DefaultCreateOptions )
45- client.CreateKeyWithOptions (keyname+" _avg" , RedisBloom.DefaultCreateOptions )
46- client.CreateRule (keyname, RedisBloom.AvgAggregation , 60 , keyname+" _avg" )
47- }
48- // Add sample with timestamp from server time and value 100
49- // TS.ADD mytest * 100
50- _ , err := client.AddAutoTs (keyname, 100 )
51- if err != nil {
52- fmt.Println (" Error:" , err)
53- }
40+ var client = redisbloom.NewClient (" localhost:6379" , " nohelp" , nil )
41+
42+ // TS.ADD mytest item
43+ _ , err := client.Add (" mytest" , " myItem" )
44+ if err != nil {
45+ fmt.Println (" Error:" , err)
46+ }
5447}
5548```
5649
You can’t perform that action at this time.
0 commit comments