// Set will persist a value to the cache or
// override existing one with the new one
15349
func (r *MemoryTTL) Set(key string, value interface{}) error {
	r.Lock()
	defer r.Unlock()

	r.cache.Set(key, value)
	r.setAts[key] = time.Now()
	return nil
}
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)
}
1343726
func (s *MemorySession) Set(key string, value interface{}) error {
	s.data[key] = value
	return nil
}
1319975
func (s *StorageOverseer) Set(w http.ResponseWriter, r *http.Request, value string) error {
	// Reuse the existing cookie ID if it exists
	sessID, _ := s.options.getCookieValue(w, r)

	if len(sessID) == 0 {
		sessID = uuid.NewV4().String()
	}

	err := s.Storer.Set(sessID, value)
	if err != nil {
		return errors.Wrap(err, "unable to set session value")
	}

	w.(cookieWriter).SetCookie(s.options.makeCookie(sessID))

	return nil
}
188283
func (rkv *KeyValue) Set(key, value string) error {
	conn := rkv.pool.Get(rkv.dbindex)
	_, err := conn.Do("SET", rkv.id+":"+key, value)
	return err
}
1344315
func (cache *HealthStatusCache) set(key HealthStatusKey, value HealthStatus, expires time.Time) {
	cache.data[key] = HealthStatusItem{value: value, expires: expires}
}
531540
func (c *xContext) Set(key string, val interface{}) {
	c.store.Set(key, val)
}
718080
func (c *attrCache) Set(id uint64, attrs map[string]interface{}) {
	c.mu.Lock()
	defer c.mu.Unlock()
	c.attrs[id] = attrs
}
151094
func (c *Cache) Set(_ context.Context, key dataloader.Key, value dataloader.Thunk) {
	c.c.Set(key.String(), value, 0)
}
422897
func (kv *KeyValue) Set(key, value string) error {
	if !kv.host.rawUTF8 {
		Encode(&value)
	}
	if _, err := kv.Get(key); err != nil {
		// Key does not exist, create it
		_, err = kv.host.db.Exec("INSERT INTO "+kv.table+" ("+keyCol+", "+valCol+") VALUES (?, ?)", key, value)
		return err
	}
	// Key exists, update the value
	_, err := kv.host.db.Exec("UPDATE "+kv.table+" SET "+valCol+" = ? WHERE "+keyCol+" = ?", value, key)
	return err
}
1155015
func (c *Context) Set(key string, value interface{}) {
	c.data[key] = value
}
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)
}
579991
func (c *Context) Set(key string, value interface{}) {
	c.Context = context.WithValue(c.Context, key, value)
}
607474
func (ai *AtomicInt) Set(newValue int) {
	atomic.StoreInt64(&ai.val, int64(newValue))
}
1310839
func (p *SessionStore) Set(key string, value interface{}) error {
	p.Lock()
	defer p.Unlock()
	p.values[key] = value
	return nil
}
810440
func (c *cache) Set(id types.UID, status *PodStatus, err error, timestamp time.Time) {
	c.lock.Lock()
	defer c.lock.Unlock()
	defer c.notify(id, timestamp)
	c.pods[id] = &data{status: status, err: err, modified: timestamp}
}
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)
	}
}