(c context.Context, key []string, forCas bool, forPeek bool)
| 183 | } |
| 184 | |
| 185 | func 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. |
no test coverage detected
searching dependent graphs…