MCPcopy Create free account
hub / github.com/golang/appengine / getMulti

Function getMulti

memcache/memcache.go:185–210  ·  view source on GitHub ↗
(c context.Context, key []string, forCas bool, forPeek bool)

Source from the content-addressed store, hash-verified

183}
184
185func getMulti(c context.Context, key []string, forCas bool, forPeek bool) (map[string]*Item, error) {
186 if len(key) == 0 {
187 return nil, nil
188 }
189 keyAsBytes := make([][]byte, len(key))
190 for i, k := range key {
191 keyAsBytes[i] = []byte(k)
192 }
193 req := &pb.MemcacheGetRequest{
194 Key: keyAsBytes,
195 ForCas: proto.Bool(forCas),
196 ForPeek: proto.Bool(forPeek),
197 }
198 res := &pb.MemcacheGetResponse{}
199 if err := internal.Call(c, "memcache", "Get", req, res); err != nil {
200 return nil, err
201 }
202 m := make(map[string]*Item, len(res.Item))
203 for _, p := range res.Item {
204 t := protoToItem(p)
205 if t != nil {
206 m[t.Key] = t
207 }
208 }
209 return m, nil
210}
211
212// Delete deletes the item for the given key.
213// ErrCacheMiss is returned if the specified item can not be found.

Callers 3

GetMultiFunction · 0.70
PeekMultiFunction · 0.70
getFunction · 0.70

Calls 2

CallFunction · 0.92
protoToItemFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…