redis
This commit is contained in:
parent
291ce2c2a4
commit
65474c0608
2
README
2
README
@ -80,4 +80,4 @@ gobyexample.com signups
|
||||
* errors
|
||||
* compilation
|
||||
* time
|
||||
* time duration
|
||||
* string to/from numbers
|
||||
|
24
src/xx-redis/main.go
Normal file
24
src/xx-redis/main.go
Normal file
@ -0,0 +1,24 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/fzzbt/radix/redis"
|
||||
)
|
||||
|
||||
func main() {
|
||||
conf := redis.DefaultConfig()
|
||||
client := redis.NewClient(conf)
|
||||
fmt.Println(conf)
|
||||
fmt.Println(client)
|
||||
|
||||
setRep := client.Set("foo", "bar")
|
||||
if setRep.Err != nil { panic(setRep.Err) }
|
||||
fmt.Println(setRep)
|
||||
|
||||
getRep := client.Get("foo")
|
||||
if getRep.Err != nil { panic(getRep.Err) }
|
||||
getStr, _ := getRep.Str()
|
||||
|
||||
fmt.Println(getRep)
|
||||
fmt.Println(getStr)
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user