// Set the value in the cache for the specified duration
973090
func (c *Cache) Set(key string, value interface{}, duration time.Duration) {
	c.set(key, value, duration)
}
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
}
1362828
func (c *memoryCache) Set(key string, data []byte) error {
	c.Lock()
	defer c.Unlock()

	c.cache[key] = data
	return nil
}
28507
func (cache *HealthStatusCache) Set(key HealthStatusKey, value HealthStatus, expire time.Duration) {
	cache.mu.Lock()
	defer cache.mu.Unlock()
	cache.set(key, value, time.Now().Add(expire))
}
684338
func (s *UpdateProjectInput) SetCache(v *ProjectCache) *UpdateProjectInput {
	s.Cache = v
	return s
}
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
}
1192756
func (c *Cache) Set(_ context.Context, key dataloader.Key, value dataloader.Thunk) {
	c.ARCCache.Add(key, value)
}
247174
func (d *DurationValue) Set(v string) error {
	if d.v == nil {
		d.v = new(time.Duration)
	}
	var err error
	*(d.v), err = time.ParseDuration(v)
	return err
}
1001125
func (c *MemoryCache) Set(key string, resp []byte) {
	c.mu.Lock()
	c.items[key] = resp
	c.mu.Unlock()
}
1369810
func (c *Cache) Set(key string, value interface{}, size int64) {
	c.Lock()
	defer c.Unlock()

	var it *Item
	elem, ok := c.m[key]
	if ok {
		// Element exists, push it to front,
		// and then update value etc.
		it = elem.Value.(*Item)
		c.size -= it.Size
		c.l.MoveToFront(elem)
	} else {
		// Insert new element.
		it = &Item{Key: key}
		elem = c.l.PushFront(it)
		c.m[key] = elem
	}
	// Set or update item content.
	it.Value = value
	it.Size = size
	if it.Size < 0 {
		panic("cache: value has negative size")
	}
	it.ModTime = time.Now()
	it.AccessTime = it.ModTime

	// Update cache size.
	if it.Size >= math.MaxInt64-c.size {
		panic("cache: value size is too big")
	}
	c.size += it.Size

	c.enforceCapacity()
}
723267
func (e *EtcdStore) Set(key string, value []byte, ttl time.Duration) error {
	c, q := context.WithTimeout(context.Background(), e.Timeout)
	defer q()

	o := &client.SetOptions{TTL: ttl}
	return set(e, c, o, key, string(value[:]))
}
259180
func (c *Cache) Set(key string, resp []byte) {
	c.db.Put([]byte(key), resp, nil)
}
389342
func (c *CacheTTL) SetExpire(key string, data interface{}, ttl int64) error {
	if key == "" {
		return nil
	}

	c.itemsMu.Lock()
	defer c.itemsMu.Unlock()

	if data == nil {
		delete(c.items, key)
		return nil
	}

	// return oldest item when the cache reaches maximum size
	if len(c.deleteQueue) >= c.maxSize {
		c.deleteOldest()
	}

	item := eurekache.NewItem()
	item.SetExpire(ttl)
	item.Value = data
	c.items[key] = item
	c.deleteQueue = append(c.deleteQueue, key)
	return nil
}
924267
func (r *Memory) Set(key string, value interface{}) error {
	r.Lock()
	defer r.Unlock()

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

	// set cache or timeout
	select {
	case <-ch:
		return
	case <-time.After(e.writeTimeout):
		return
	}
}
601929
func (m *MongoCache) SetEx(key string, duration time.Duration, value interface{}) error {
	return m.set(key, duration, value)
}
1036288
func (s *DescribeReservedCacheNodesOfferingsInput) SetDuration(v string) *DescribeReservedCacheNodesOfferingsInput {
	s.Duration = &v
	return s
}