// Get looks up a key's value from the cache.
191992
func (c *Cache) Get(key string) (value interface{}, ok bool) {
	if c.cache == nil {
		return
	}
	if ele, hit := c.cache[key]; hit {
		c.ll.MoveToFront(ele)
		return ele.Value.(*entry).value, true
	}
	return
}
616508
func (c *Ctx) Get(key interface{}) (value interface{}, exists bool) {
	value = c.request.Context().Value(key)
	exists = value != nil
	return
}
279092
func (c *RedisCacher) Get(key string) interface{} {
	val, err := c.c.Get(c.prefix + key).Result()
	if err != nil {
		return nil
	}
	return val
}
119432
func (kv *KV) Get(key []byte) (value []byte) {
	value, _ = kv.db.Get(key, nil)
	return
}
876099
func (km *KeyManager) Get(k Key) KeyState {
	km.mutex.RLock()
	ks := km.mapper[k]
	km.mutex.RUnlock()

	return ks
}
660257
func (ds *RemoteCache) Get(key string) (interface{}, error) {
	return ds.client.Get(key)
}
534569
func (mc *Connection) Get(keys ...string) (results []cacheservice.Result, err error) {
	defer handleError(&err)
	results = mc.get("get", keys)
	return
}
1280188
func (c *MemoryStore) Get(key string) (interface{}, error) {
	item, _ := c.cache.Get(key)
	return item, nil
}
1365930
func (c *TwoQueueCache) Get(key interface{}) (value interface{}, ok bool) {
	c.lock.Lock()
	defer c.lock.Unlock()

	// Check if this is a frequent value
	if val, ok := c.frequent.Get(key); ok {
		return val, ok
	}

	// If the value is contained in recent, then we
	// promote it to frequent
	if val, ok := c.recent.Peek(key); ok {
		c.recent.Remove(key)
		c.frequent.Add(key, val)
		return val, ok
	}

	// No hit
	return nil, false
}
11865
func (c cache) Get(key string) (resp []byte, ok bool) {
	item, err := redis.Bytes(c.Do("GET", cacheKey(key)))
	if err != nil {
		return nil, false
	}
	return item, true
}
410436
func (m *MongoCache) Get(key string) (interface{}, error) {
	data, err := m.get(key)
	if err == mgo.ErrNotFound {
		return nil, ErrNotFound
	}

	if err != nil {
		return nil, err
	}

	return data.Value, nil
}
118958
func (c *Cacher) Get(key string) map[string]interface{} {
	c.mu.RLock()
	defer c.mu.RUnlock()
	if v, ok := c.data[key]; ok {
		return map[string]interface{}{
			key: v,
		}
	}
	ret := make(map[string]interface{})
	for k, v := range c.data {
		if strings.HasPrefix(k, key) {
			ret[k] = v
		}
	}
	return ret
}
923191
func (t *timedCache) Get(key string) (interface{}, error) {
	entry, err := t.getInternal(key)
	if err != nil {
		return nil, err
	}

	// Data is still not cached yet, cache it by getter.
	if entry.data == nil {
		entry.lock.Lock()
		defer entry.lock.Unlock()

		if entry.data == nil {
			data, err := t.getter(key)
			if err != nil {
				return nil, err
			}

			entry.data = data
		}
	}

	return entry.data, nil
}
446393
func (c *LRUCache) Get(key Key) (value interface{}, ok bool) {
	defer c.mutex.Unlock()
	c.mutex.Lock()

	if ele, hit := c.cache[key]; hit {
		entry := ele.Value.(*cacheRecord)

		// If the entry has expired, remove it from the cache
		if entry.expireAt != nil && entry.expireAt.Before(time.Now().UTC()) {
			c.removeElement(ele)
			c.stats.Miss++
			return
		}
		c.stats.Hit++
		c.ll.MoveToFront(ele)
		return entry.value, true
	}
	c.stats.Miss++
	return
}
256559
func (c *constCache) Get(key string) ([]byte, error) {
	return c.data, nil
}
105400
func (c *Cache) Get(ctx context.Context, key interface{}) (interface{}, bool) {
	now := clock.Now(ctx)

	// We need a Read/Write lock here because if the entry is present, we are
	// going to need to promote it "lru".
	c.lock.Lock()
	defer c.lock.Unlock()

	if e := c.cache[key]; e != nil {
		ent := e.Value.(*cacheEntry)
		if !c.isEntryExpired(now, ent) {
			c.lru.MoveToFront(e)
			return ent.v, true
		}
		c.evictEntryLocked(e)
	}

	return nil, false
}
72933
func (c *MemoryCacher) Get(key string) interface{} {
	c.lock.RLock()
	defer c.lock.RUnlock()

	item, ok := c.items[key]
	if !ok {
		return nil
	}
	if item.hasExpired() {
		go c.Delete(key)
		return nil
	}
	return item.val
}