www.3112.net > golAng操作rEDis需要哪一个连接库

golAng操作rEDis需要哪一个连接库

我正在用这个包 https://github.com/garyburd/redigo

go-redis/redis 这个用的比较多,应该还有很多吧,找到自己够用的就好

packagemainimport("fmt""github.com/garyburd/redigo/redis")funcmain(){conn,err:=redis.Dial("tcp","127.0.0.1:6379")iferr!=nil{panic(err)}deferconn.Close()conn.Do("SET","app1","test1")conn.Do("SET","app2","test2")val,err:=redis.St...

package main import ( "fmt" "github.com/garyburd/redigo/redis" ) func main() { conn, err := redis.Dial("tcp", "127.0.0.1:6379") if err != nil { panic(err) } defer conn.Close() conn.Do("SET", "app1", "test1") conn.Do("SET", "app...

olang的安装非常简单,因为官网被墙,可以从国内镜像如studygolang.com下载。 [root@vm root]$ tar -C /usr/local -zxf go1.4.2.linux-amd64.tar.gz [root@vm root]$ vim /etc/profile export GOROOT=/usr/local/go export PATH=$GOROOT/bin:$PA...

网站地图

All rights reserved Powered by www.3112.net

copyright ©right 2010-2021。
www.3112.net内容来自网络,如有侵犯请联系客服。zhit325@qq.com