// Set - Will persist a value into cache.
774548
func (r *bucketLocationCache) Set(bucketName string, location string) {
	r.Lock()
	defer r.Unlock()
	r.items[bucketName] = location
}
1344315
func (cache *HealthStatusCache) set(key HealthStatusKey, value HealthStatus, expires time.Time) {
	cache.data[key] = HealthStatusItem{value: value, expires: expires}
}
614379
func (ds *RemoteCache) Set(key string, value interface{}, expire time.Duration) error {
	if expire == 0 {
		expire = defaultMaxCacheExpiration
	}

	return ds.client.Set(key, value, expire)
}
727889
func (l *LFUNoTS) set(key string, value interface{}) error {
	res, err := l.cache.Get(key)
	if err != nil && err != ErrNotFound {
		return err
	}

	if err == ErrNotFound {
		//create new cache item
		ci := newCacheItem(key, value)

		// if cache size si reached to max size
		// then first remove lfu item from the list
		if l.currentSize >= l.size {
			// then evict some data from head of linked list.
			l.evict(l.frequencyList.Front())
		}

		l.cache.Set(key, ci)
		l.incr(ci)

	} else {
		//update existing one
		val := res.(*cacheItem)
		val.v = value
		l.cache.Set(key, val)
		l.incr(res.(*cacheItem))
	}

	return nil
}
237455
func (e *Eurekache) Set(key string, data interface{}) {
	ch := make(chan bool, 1)
	// set cache
	go func() {
		for _, c := range e.caches {
			c.Set(key, data)
		}
		ch <- true
	}()

	// set cache or timeout
	select {
	case <-ch:
		return
	case <-time.After(e.writeTimeout):
		return
	}
}
1295534
func (st *CookieSessionStore) Set(key, value interface{}) {
	st.lock.Lock()
	defer st.lock.Unlock()
	st.values[key] = value
}
26981
func (s *Session) Set(key string, value interface{}) {
	s.set(key, value, false)
}
1329555
func (hm *SyncedHashMap) Set(key Hashable, value interface{}) {
	hm.Lock()
	defer hm.Unlock()
	(*hm).keys[key.Hash()] = key
	(*hm).values[key.Hash()] = value
}
249261
func (c *Cache) Set(key string, resp []byte) {
	item := &memcache.Item{
		Key:   cacheKey(key),
		Value: resp,
	}
	c.Client.Set(item)
}
1155015
func (c *Context) Set(key string, value interface{}) {
	c.data[key] = value
}
303851
func (s *CacheOnStorage) Set(item interface{}) error {
	if err := s.storage.Set(item); err != nil {
		return err
	}

	return s.cache.Set(item)
}
516320
func (h Hash) Set(key string, value interface{}) Hash {
	h[key] = Value(valueToBytes(value))
	return h
}
938617
func (c *SimpleLRUCache) Set(key string, value interface{}) {
	item := cacheItem{
		key:     key,
		value:   value,
		expires: timeFunc().Add(c.expiration),
	}

	c.lruCache.Add(key, item)
}
1046468
func (c *certificateCache) set(addr string, certificate ssh.Signer, ttl time.Duration) error {
	c.mu.Lock()
	defer c.mu.Unlock()

	err := c.cache.Set(addr, certificate, ttl)
	if err != nil {
		return trace.Wrap(err)
	}

	return nil
}
718694
func (c *Cache) Set(key string, resp []byte) {
	item := &memcache.Item{
		Key:   cacheKey(key),
		Value: resp,
	}
	if err := memcache.Set(c.Context, item); err != nil {
		c.Context.Errorf("error caching response: %v", err)
	}
}
721977
func (s *memcachedStorage) Set(key string, val interface{}, expires time.Duration) error {
	item := &cachedItem{Val: val}
	bytes, err := encodeGob(item)
	if err != nil {
		return err
	}

	var expiresInSeconds int64
	if expires != 0 {
		expiresInSeconds = int64(expires) / int64(time.Second)
	}

	memcachedItem := newItem(key, bytes, int32(expiresInSeconds))
	return s.c.Set(memcachedItem)
}
579991
func (c *Context) Set(key string, value interface{}) {
	c.Context = context.WithValue(c.Context, key, value)
}