// Set sets the given value in a metadata.
//
// It works analogously to http.Header.Set, overwriting all previous metadata values.
//
// The function is binary-key safe.
555769
func (m NiceMD) Set(key string, value string) NiceMD {
	k, v := encodeKeyValue(key, value)
	m[k] = []string{v}
	return m
}
278253
func (m *Map) Set(k []byte, v MapValue) {
	m.set(k, v, mapKeyOptions{
		copyKey:     true,
		finalizeKey: m.finalize != nil,
	})
}
604742
func (r *Response) Set(key, value string) {
	r.handlerHeader.Set(key, value)
}
469698
func (h Header) Set(key, value string) {
	h[textproto.CanonicalMIMEHeaderKey(key)] = []string{value}
}
938424
func (c *cookies) Set(ck *http.Cookie) {
	http.SetCookie(c.ResponseWriter, ck)
}
149708
func (m *MemBytes) Set(value string) error {
	val, err := units.RAMInBytes(value)
	*m = MemBytes(val)
	return err
}
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()
}
286431
func (c *Strings) Set(value string) error {
	*c = append(*c, value)
	return nil
}
639304
func (s *mem) Set(sid string, lifetime LifeTime, key string, value interface{}, immutable bool) {
	s.mu.RLock()
	s.values[sid].Save(key, value, immutable)
	s.mu.RUnlock()
}
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
}
461530
func (r *RequestParams) Set(key, value string) {
	r.Store.Set(key, value)
}
576002
func (c *Client) Set(key, val string, flags, exp uint32, ocas uint64) (cas uint64, err error) {
	// Variants: [R] Set [Q]
	return c.setGeneric(opSet, key, val, ocas, flags, exp)
}
981385
func (f *fileStorage) Set(key string, value []byte) error {
	file, err := f.fileForWrite(key)

	if err != nil {
		return err
	}

	defer file.Close()

	_, err = file.Write(value)
	return err
}
684076
func (cache *Cache) Set(key string, im *imageserver.Image, params imageserver.Params) error {
	data, err := im.MarshalBinary()
	if err != nil {
		return err
	}
	return cache.setData(key, data)
}
59171
func (f *Values) Set(key, val string) {
	for i, v := range f.values {
		if v.Key == key {
			f.values[i].Value = val
			return
		}
	}

	f.Add(key, val)
}
819391
func (t *TagMap) Set(key string) error {
	return (*stringmapflag.Value)(t).Set(key)
}
757225
func (b *Batch) Set(key, value []byte) {
	if len(b.data) == 0 {
		b.init(len(key) + len(value) + 2*binary.MaxVarintLen64 + batchHeaderLen)
	}
	if b.increment() {
		b.data = append(b.data, byte(internalKeyKindSet))
		b.appendStr(key)
		b.appendStr(value)
	}
}