See type memcache.Codec, this can be used to convert memcache elements. The appengine / memcache package contains two ready-made codecs, memcache.Gob and memcache.JSON. You use these codecs instead of directly calling to store and retrieve elements from the cache, for example, for example, for an element encoded in gob:
item := &memcache.Item{ Key: myCacheKey, Object: &myLinkVar, } err := memcache.Gob.Set(context, item)
source share