Skip to content

Instantly share code, notes, and snippets.

@mogeta
Created April 16, 2013 14:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mogeta/5396521 to your computer and use it in GitHub Desktop.
Save mogeta/5396521 to your computer and use it in GitHub Desktop.
gae/g using memcached
func dataStore(c appengine.Context, id string) {
m = make(map[string]int32)
_, err := memcache.JSON.Get(c, "names", &m)
if err != nil && err != memcache.ErrCacheMiss {
return
}
c.Infof("%s", m)
m[id] = int32(time.Now().Unix())
_ = memcache.JSON.Set(c, &memcache.Item{
Key: "names", Object: m,
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment