gomemcache 是go语言的memcache客户端库。
安装
使用 go get
$ go get github.com/bradfitz/gomemcache/memcache
此命令后gomemcache即可使用。它的来源将是:
$GOPATH/src/github.com/bradfitz/gomemcache/memcache
示例
import ( "github.com/bradfitz/gomemcache/memcache" ) func main() { mc := memcache.New("10.0.0.1:11211", "10.0.0.2:11211", "10.0.0.3:11212") mc.Set(&memcache.Item{Key: "foo", Value: []byte("my value")}) it, err := mc.Get("foo") ... }
全部文档,参见:
访问 https://godoc.org/github.com/bradfitz/gomemcache/memcache
运行:
$ godoc github.com/bradfitz/gomemcache/memcache