// Set implements imageserver/cache.Cache.
189054
func (cache *Cache) Set(key string, image *imageserver.Image, params imageserver.Params) error {
	item := &item{
		image: image,
	}
	cache.lru.Set(key, item)
	return nil
}
104690
func (r *ShardedTTL) Set(tenantID, key string, value interface{}) error {
	r.Lock()
	defer r.Unlock()

	r.cache.Set(tenantID, key, value)
	_, ok := r.setAts[tenantID]
	if !ok {
		r.setAts[tenantID] = make(map[string]time.Time)
	}
	r.setAts[tenantID][key] = time.Now()
	return nil
}
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
}
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)
	}
}
820135
func (c *Cache) Set(key, value string) bool {
	c.mu.Lock()
	defer c.mu.Unlock()

	// If already present, move to front of queue and restart the clock
	// (no need to update map as we're modifying the entry it already contains)
	if ee, ok := c.cache[key]; ok {
		c.ll.MoveToFront(ee)
		ent := ee.Value.(*entry)
		ent.value = value
		ent.expiration = c.newExpiration()
		return false
	}

	// If not present, add to cache and queue
	ele := c.ll.PushFront(&entry{key, value, c.newExpiration()})
	c.cache[key] = ele

	if c.ll.Len() > c.maxEntries {
		c.removeOldest()
	}
	return true
}
726901
func (c *Cache) Set(itmID string, value interface{}, grpIDs []string) {
	if c.maxEntries == DisabledCaching {
		return
	}
	c.Lock()
	defer c.Unlock()
	now := time.Now()
	if ci, ok := c.cache[itmID]; ok {
		ci.value = value
		c.remItemFromGroups(itmID, ci.groupIDs)
		ci.groupIDs = grpIDs
		c.addItemToGroups(itmID, grpIDs)
		if c.maxEntries != UnlimitedCaching { // update lru indexes
			c.lruIdx.MoveToFront(c.lruRefs[itmID])
		}
		if c.ttl > 0 && !c.staticTTL { // update ttl indexes
			ci.expiryTime = now.Add(c.ttl)
			c.ttlIdx.MoveToFront(c.ttlRefs[itmID])
		}
		return
	}
	ci := &cachedItem{itemID: itmID, value: value, groupIDs: grpIDs}
	c.cache[itmID] = ci
	c.addItemToGroups(itmID, grpIDs)
	if c.maxEntries != UnlimitedCaching {
		c.lruRefs[itmID] = c.lruIdx.PushFront(ci)
	}
	if c.ttl > 0 {
		ci.expiryTime = now.Add(c.ttl)
		c.ttlRefs[itmID] = c.ttlIdx.PushFront(ci)
	}
	if c.maxEntries != UnlimitedCaching {
		var lElm *list.Element
		if c.lruIdx.Len() > c.maxEntries {
			lElm = c.lruIdx.Back()
		}
		if lElm != nil {
			c.remove(lElm.Value.(*cachedItem).itemID)
		}
	}
}
1184022
func (c *LFUCache) Set(key, value interface{}) error {
	c.mu.Lock()
	defer c.mu.Unlock()
	_, err := c.set(key, value)
	return err
}
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
	}
}
1192756
func (c *Cache) Set(_ context.Context, key dataloader.Key, value dataloader.Thunk) {
	c.ARCCache.Add(key, value)
}
1257272
func (p *pullFuture) set(imageID string, err error) {
	p.imageID = imageID
	p.err = err
	close(p.waitCh)
}
653950
func (this *Server) Set(n string, v ...string) string {
	if len(v) == 0 {
		return this.settings[n]
	}
	this.settings[n] = v[0]
	return v[0]
}
319563
func (s *SyncString) Set(v string) {
	s.Lock()
	defer s.Unlock()
	s.string = v
}
1022603
func (m *DiskCacheMode) Set(s string) error {
	*m = DiskCacheModeOff
	switch strings.ToLower(strings.TrimSpace(s)) {
	case "local":
		*m = DiskCacheModeLocal
	case "remote":
		*m = DiskCacheModeRemote
	}
	return nil
}
712236
func (c *cache) Set(path string, ignore GitIgnore) {
	if ignore == nil {
		return
	}

	// ensure the map is defined
	if c._i == nil {
		c._i = make(map[string]GitIgnore)
	}

	// set the cache item
	c._lock.Lock()
	c._i[path] = ignore
	c._lock.Unlock()
}
1217818
func (c *writeTroughCache) Set(key string, data []byte) error {
	err := c.memory.Set(key, data)
	if err != nil {
		return err
	}

	err = c.file.Set(key, data)
	if err != nil {
		return err
	}

	return nil
}
585883
func (u *streamServerURI) Set(v string) error {
	uri := streamServerURI(v)
	if _, err := uri.resolve(context.Background()); err != nil {
		return err
	}
	*u = uri
	return nil
}
673536
func (c *fileCache) Set(key string, data []byte) error {
	err := os.MkdirAll(c.dirname, 0700)
	if err != nil {
		return err
	}
	return ioutil.WriteFile(c.filename(key), data, 0644)
}