rainycape / memcache Goto Github PK
View Code? Open in Web Editor NEWHigh performance memcache client in Go (golang)
License: Apache License 2.0
High performance memcache client in Go (golang)
License: Apache License 2.0
I can't seem to get the Expiration property to be set:
package main
import (
// "github.com/bradfitz/gomemcache/memcache" // "io/ioutil"
"github.com/rainycape/memcache"
"log"
)
func main() {
mc, errc := memcache.New("72.2.112.213:11211")
mc.Set(&memcache.Item{Key: "foo", Value: []byte("my value"), Expiration: 604800})
it, err := mc.Get("foo")
log.Print(it.Key)
log.Print(string(it.Value))
log.Print(it.Expiration)
log.Print(err)
}
outputs:
go run mc.go
2016/10/13 08:50:48 foo
2016/10/13 08:50:48 my value
2016/10/13 08:50:48 0
2016/10/13 08:50:48 <nil>
Where I feel it should output 604800 instead of 0.
Note that I see the same issue with bradfitz/gomemcache. Can you help?
P.S. your readme.md example doesn't take into account that memcache.New() now returns multiple values.
go version go1.7.1 darwin/amd64
memcached:1.4.24
1031fa0 does not pass unit test with Go 1.10
+ GOPATH=/builddir/build/BUILD/memcache-1031fa0ce2f20c1c0e1e1b51951d8ea02c84fa05/_build:/usr/share/gocode
+ go test -buildmode pie -compiler gc -ldflags '-extldflags '\''-Wl,-z,relro '\'''
# github.com/rainycape/memcache
./memcache_test.go:45: Skip call has possible formatting directive %s
FAIL github.com/rainycape/memcache [build failed]
It is usefull to support memcached append command
$ go get gopkgs.com/memcache.v2
Cloning into '/Users/daniel/go/src/gopkgs.com/memcache.v2'...
fatal: repository 'http://gopkgs.com/memcache.v2/' not found
package gopkgs.com/memcache.v2: exit status 128
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.