// Get retrieves a regexp object from the cache based upon the pattern.
// If the pattern is not found in the cache, create one
180794
func (rc *regexpCache) Get(pattern string) (re *regexp.Regexp, err error) {
	var ok bool

	if re, ok = rc.get(pattern); !ok {
		re, err = regexp.Compile(pattern)
		if err != nil {
			return nil, err
		}
		rc.set(pattern, re)
	}

	return re, nil
}
214023
func (c *fileCache) Get(key string) ([]byte, error) {
	cached, err := ioutil.ReadFile(c.filename(key))
	if err != nil {
		// check the error
		if _, ok := err.(*os.PathError); !ok {
			return nil, err
		}
	}

	return cached, nil
}
1103036
func (m mapFetcher) Get(key string) (val string, ok bool) {
	all := m.GetAll(key)

	if len(all) == 0 {
		return "", false
	}
	return all[len(all)-1], true
}
554400
func (l *LRUNoTS) Get(key string) (interface{}, error) {
	res, err := l.cache.Get(key)
	if err != nil {
		return nil, err
	}

	elem := res.(*list.Element)
	// move found item to the head
	l.list.MoveToFront(elem)

	return elem.Value.(*kv).v, nil
}
660257
func (ds *RemoteCache) Get(key string) (interface{}, error) {
	return ds.client.Get(key)
}
499083
func Get(pattern web.PatternType, handler web.HandlerType) {
	DefaultMux.Get(pattern, handler)
}
466960
func (f Caches) Get(name string) *Cache {
	return f[strings.ToLower(name)]
}
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
}
621924
func (r *Memory) Get(key string) (interface{}, error) {
	r.Lock()
	defer r.Unlock()

	return r.cache.Get(key)
}
534569
func (mc *Connection) Get(keys ...string) (results []cacheservice.Result, err error) {
	defer handleError(&err)
	results = mc.get("get", keys)
	return
}
102852
func (g *NamespaceGetter) Get(key uint64, setFunc func() (size int, value Value)) *Handle {
	return g.Cache.Get(g.NS, key, setFunc)
}
442695
func (c *writeTroughCache) Get(key string) ([]byte, error) {
	// Try to read from memory cache
	data, err := c.memory.Get(key)
	if err != nil {
		return nil, err
	}

	if data != nil {
		return data, nil
	}

	// Try to read from cache file
	data, err = c.file.Get(key)
	if err != nil {
		return nil, err
	}

	// Store in memory cache and return
	err = c.memory.Set(key, data)
	if err != nil {
		return nil, err
	}

	return data, nil
}
1333240
func (l *SimpleLRUCache) Get(key Key) (value Value, ok bool) {
	element, exists := l.elements[string(key.Hash())]
	if !exists {
		return nil, false
	}
	l.cache.MoveToFront(element)
	return element.Value.(*cacheEntry).value, true
}
540162
func (ng *etcdv3AutoCertCache) Get(ctx context.Context, rawKey string) ([]byte, error) {
	key := ng.normalize(rawKey)
	r, err := ng.client.Get(ctx, key)
	if err != nil {
		return nil, err
	}
	if r.Count == 0 {
		return nil, autocert.ErrCacheMiss
	}
	if r.Count > 1 {
		log.Errorf("Against all odds, multiple results returned from Etcd when looking for single key: %s. "+
			"Returning the first one.", key)
	}
	return r.Kvs[0].Value, nil
}
570254
func (s *CacheOnStorage) Get(key interface{}) (interface{}, error) {
	if item, err := s.cache.Get(key); err != nil {
		return nil, err
	} else if item != nil {
		return item, nil
	}

	item, err := s.storage.Get(key)
	if err != nil {
		return nil, err
	}

	if err := s.cache.Set(item); err != nil {
		// XXX: Maybe make this a non error
		return nil, err
	}
	return item, nil
}
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
}
1155321
func (cache *Cache) Get(key string, params imageserver.Params) (*imageserver.Image, error) {
	value, ok := cache.lru.Get(key)
	if !ok {
		return nil, nil
	}
	item := value.(*item)
	image := item.image
	return image, nil
}