// Set safely sets a value on the Instance's storage.
4887
func (c *Controller) Set(key, val interface{}) {
	c.instance.StorageMu.Lock()
	c.instance.Storage[key] = val
	c.instance.StorageMu.Unlock()
}
380051
func (r *RedisStore) Set(key string, value interface{}) error {
	return r.client.Set(key, value, r.expiration).Err()
}
880092
func (s *Session) Set(key string, value interface{}) error {
	s.isDirty = true

	s.data[key] = value
	return nil
}
131460
func (f storageFlag) Set(s string) error {
	fields := strings.SplitN(s, "=", 2)
	if len(fields) < 2 {
		if f.bundleStores != nil {
			return errors.New("expected [<application>:]<store>=<constraints>")
		}
		return errors.New("expected <store>=<constraints>")
	}
	var applicationName, storageName string
	if colon := strings.IndexRune(fields[0], ':'); colon >= 0 {
		if f.bundleStores == nil {
			return errors.New("expected <store>=<constraints>")
		}
		applicationName = fields[0][:colon]
		storageName = fields[0][colon+1:]
	} else {
		storageName = fields[0]
	}
	cons, err := storage.ParseConstraints(fields[1])
	if err != nil {
		return errors.Annotate(err, "cannot parse disk constraints")
	}
	var stores map[string]storage.Constraints
	if applicationName != "" {
		if *f.bundleStores == nil {
			*f.bundleStores = make(map[string]map[string]storage.Constraints)
		}
		stores = (*f.bundleStores)[applicationName]
		if stores == nil {
			stores = make(map[string]storage.Constraints)
			(*f.bundleStores)[applicationName] = stores
		}
	} else {
		if *f.stores == nil {
			*f.stores = make(map[string]storage.Constraints)
		}
		stores = *f.stores
	}
	stores[storageName] = cons
	return nil
}
838325
func (m *SafeMap) Set(k interface{}, v interface{}) bool {
	m.lock.Lock()
	defer m.lock.Unlock()
	if val, ok := m.bm[k]; !ok {
		m.bm[k] = v
	} else if val != v {
		m.bm[k] = v
	} else {
		return false
	}
	return true
}
516320
func (h Hash) Set(key string, value interface{}) Hash {
	h[key] = Value(valueToBytes(value))
	return h
}
402962
func (s HTTPStore) Set(name string, blob []byte) error {
	return s.SetMulti(map[string][]byte{name: blob})
}
588721
func (r *RequestContext) Set(key string, value interface{}) {
	r.mutex.Lock()
	r.store[key] = value
	r.mutex.Unlock()
}
568576
func (f attachStorageFlag) Set(s string) error {
	if s == "" {
		return nil
	}
	for _, id := range strings.Split(s, ",") {
		if !names.IsValidStorage(id) {
			return errors.NotValidf("storage ID %q", id)
		}
		*f.storageIDs = append(*f.storageIDs, id)
	}
	return nil
}
206982
func (s *RedisMapStore) Set(key string, value interface{}, properties ...string) error {
	key, vmap, err := s.prepare(key, value, properties...)
	if err != nil {
		return err
	}
	if len(vmap) == 0 {
		return nil
	}
	return s.client.HMSet(key, vmap).Err()
}
72953
func (m *MemoryStore) Set(name string, meta []byte) error {
	m.data[name] = meta

	parsedMeta := &data.SignedMeta{}
	err := json.Unmarshal(meta, parsedMeta)
	if err == nil {
		// no parse error means this is metadata and not a key, so store by version
		version := parsedMeta.Signed.Version
		versionedName := fmt.Sprintf("%d.%s", version, name)
		m.data[versionedName] = meta
	}

	checksum := sha256.Sum256(meta)
	path := utils.ConsistentName(name, checksum[:])
	m.consistent[path] = meta
	return nil
}
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
}
224371
func (c *Func) Set(key string, image *imageserver.Image, params imageserver.Params) error {
	return c.SetFunc(key, image, params)
}
229516
func (s *Store) Set(ctx context.Context, name string, value []byte) error {
	filename := filepath.Join(s.path, filepath.Clean(name))
	filedir := filepath.Dir(filename)
	if !fsutil.IsDir(filedir) {
		if err := os.MkdirAll(filedir, 0700); err != nil {
			return err
		}
	}
	out.Debug(ctx, "fs.Set(%s) - %s", name, filepath.Join(s.path, name))
	return ioutil.WriteFile(filepath.Join(s.path, name), value, 0644)
}
520119
func (s *DB) Set(name string, value interface{}) *DB {
	return s.clone().InstantSet(name, value)
}
1310839
func (p *SessionStore) Set(key string, value interface{}) error {
	p.Lock()
	defer p.Unlock()
	p.values[key] = value
	return nil
}
531540
func (c *xContext) Set(key string, val interface{}) {
	c.store.Set(key, val)
}