Usage example • CI Status • License
redy
is a tiny Redis client based on radix.v2 code base.
package main
import (
"fmt"
"time"
"github.com/essentialkaos/redy/v4"
)
func main() {
rc := redy.Client{
Network: "tcp",
Addr: "127.0.0.1:6379",
DialTimeout: 15 * time.Second,
}
err := rc.Connect()
if err != nil {
fmt.Printf("Connection error: %v\n", err)
return
}
r := rc.Cmd("SET", "ABC", 1)
if r.Err != nil {
fmt.Printf("Command error: %v\n", r.Err)
return
}
r = rc.Cmd("GET", "ABC")
if r.Err != nil {
fmt.Printf("Command error: %v\n", r.Err)
return
}
val, err := r.Int()
if err != nil {
fmt.Printf("Parsing error: %v\n", err)
return
}
fmt.Printf("ABC -> %d\n", val)
}
Branch | Status |
---|---|
master |
|
develop |