// GetGobBytes searches cache on memory by given key and returns gob-encoded value.
6827
func (c *CacheTTL) GetGobBytes(key string) ([]byte, bool) {
	c.itemsMu.RLock()
	defer c.itemsMu.RUnlock()

	if item, ok := c.items[key]; ok {
		if c.isValidItem(item) {
			var buf bytes.Buffer
			enc := gob.NewEncoder(&buf)
			err := enc.Encode(item.Value)
			if err == nil {
				return buf.Bytes(), true
			}
		}
	}

	return []byte{}, false
}
1049167
func (c *RedisCache) Get(key string, data interface{}) bool {
	b, ok := c.GetGobBytes(key)
	if !ok {
		return false
	}

	dec := gob.NewDecoder(bytes.NewBuffer(b))
	dec.Decode(data)
	return true
}
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
}
402619
func (c *Identify2Cache) Get(uid keybase1.UID, gctf GetCheckTimeFunc, gcdf GetCacheDurationFunc, breaksOK bool) (*keybase1.Identify2ResUPK2, error) {
	v, err := c.cache.Get(string(uid))
	if err != nil {
		if err == ramcache.ErrNotFound {
			return nil, nil
		}
		return nil, err
	}
	up, ok := v.(*keybase1.Identify2ResUPK2)
	if !ok {
		return nil, fmt.Errorf("invalid type in cache: %T", v)
	}

	if gctf != nil {
		then := gctf(*up)
		if then == 0 {
			return nil, IdentifyTimeoutError{}
		}
		if up.TrackBreaks != nil && !breaksOK {
			return nil, TrackBrokenError{}
		}

		thenTime := keybase1.FromTime(then)
		timeout := gcdf(*up)
		if time.Since(thenTime) > timeout {
			return nil, IdentifyTimeoutError{}
		}
	}

	return up, nil
}
1017368
func GetKeys(tag string) []string {
	result := []string{}

	// from reflect.StructTag.Get(string)

	for tag != "" {
		// skip leading space
		i := 0
		for i < len(tag) && tag[i] == ' ' {
			i++
		}
		tag = tag[i:]
		if tag == "" {
			break
		}

		// scan to colon.
		// a space or a quote is a syntax error
		i = 0
		for i < len(tag) && tag[i] != ' ' && tag[i] != ':' && tag[i] != '"' {
			i++
		}
		if i+1 >= len(tag) || tag[i] != ':' || tag[i+1] != '"' {
			break
		}
		name := string(tag[:i])
		result = append(result, name)
		tag = tag[i+1:]

		// scan quoted string to find value
		i = 1
		for i < len(tag) && tag[i] != '"' {
			if tag[i] == '\\' {
				i++
			}
			i++
		}
		if i >= len(tag) {
			break
		}
		tag = tag[i+1:]
	}
	return result
}
588447
func (c *Cache) Get(key interface{}) (value interface{}, ok bool) {
	c.lock.Lock()
	value, ok = c.lru.Get(key)
	c.lock.Unlock()
	return value, ok
}
391255
func (bsh *BufferedServerHeader) GetKeys() (value []string) {
	if bsh.released {
		value = bsh.original.GetKeys()
	} else {
		value = bsh.original.GetKeys()
		for key := range bsh.headerMap {
			found := false
			for _,v := range value {
				if v==key {
					found = true
					break
				}
			}
			if !found {
				value = append(value,key)
			}
		}
	}
	return
}
178601
func (m *memDbBuffer) Get(k Key) ([]byte, error) {
	v, err := m.db.Get(k)
	if terror.ErrorEqual(err, leveldb.ErrNotFound) {
		return nil, ErrNotExist
	}
	return v, nil
}
536137
func (c *client) GetEntries(key string) ([]string, error) {
	resp, err := c.keysAPI.Get(c.ctx, key, &etcd.GetOptions{Recursive: true})
	if err != nil {
		return nil, err
	}

	// Special case. Note that it's possible that len(resp.Node.Nodes) == 0 and
	// resp.Node.Value is also empty, in which case the key is empty and we
	// should not return any entries.
	if len(resp.Node.Nodes) == 0 && resp.Node.Value != "" {
		return []string{resp.Node.Value}, nil
	}

	entries := make([]string, len(resp.Node.Nodes))
	for i, node := range resp.Node.Nodes {
		entries[i] = node.Value
	}
	return entries, nil
}
352130
func (cdb *CDB) Get(key []byte) ([]byte, error) {
	hash := cdb.hash(key)

	table := cdb.index[hash&0xff]
	if table.length == 0 {
		return nil, nil
	}

	// Probe the given hash table, starting at the given slot.
	startingSlot := (hash >> 8) % table.length
	slot := startingSlot

	for {
		slotOffset := table.offset + (8 * slot)
		slotHash, offset, err := readTuple(cdb.reader, slotOffset)
		if err != nil {
			return nil, err
		}

		// An empty slot means the key doesn't exist.
		if slotHash == 0 {
			break
		} else if slotHash == hash {
			value, err := cdb.getValueAt(offset, key)
			if err != nil {
				return nil, err
			} else if value != nil {
				return value, nil
			}
		}

		slot = (slot + 1) % table.length
		if slot == startingSlot {
			break
		}
	}

	return nil, nil
}
668875
func (c *MemoryStore) GetMaps(keys []string) (map[string]map[string]interface{}, error) {
	values := make(map[string]map[string]interface{}, len(keys))
	for _, v := range keys {
		value, _ := c.GetMap(v)
		if value != nil {
			values[v] = value
		}
	}

	return values, nil
}
76157
func (cache *DiskQuotaCacheLocal) Get(
	ctx context.Context, id keybase1.UserOrTeamID) (
	info kbfsblock.QuotaInfo, err error) {
	cache.lock.RLock()
	defer cache.lock.RUnlock()
	err = cache.checkCacheLocked(ctx, "Quota(Get)")
	if err != nil {
		return kbfsblock.QuotaInfo{}, err
	}

	return cache.getQuotaLocked(id, metered)
}
1072878
func (c *Cache) Get(key string) (resp []byte, ok bool) {
	key = keyToFilename(key)
	resp, err := c.d.Read(key)
	if err != nil {
		return []byte{}, false
	}
	return resp, 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
}
581783
func (c *Config) GetKeyOk(key Key) (v interface{}, ok bool) {
	return c.values.GetOk(key)
}
442221
func (c *BigCache) Get(key string) ([]byte, error) {
	hashedKey := c.hash.Sum64(key)
	shard := c.getShard(hashedKey)
	return shard.get(key, hashedKey)
}
276623
func (c *LruCache) Get(key string) ([]byte, bool) {
	c.mu.Lock()

	le, ok := c.cache[key]
	if !ok {
		c.mu.Unlock() // Avoiding defer overhead
		return nil, false
	}

	if c.MaxAge > 0 && le.Value.(*entry).expires <= time.Now().Unix() {
		c.deleteElement(le)
		c.maybeDeleteOldest()

		c.mu.Unlock() // Avoiding defer overhead
		return nil, false
	}

	c.lru.MoveToBack(le)
	value := le.Value.(*entry).value

	c.mu.Unlock() // Avoiding defer overhead
	return value, true
}