// HSet sets a hash key.
// If there is another key by the same name it will be gone.
16693
func (m *Miniredis) HSet(k, f, v string) {
	m.DB(m.selectedDB).HSet(k, f, v)
}
131238
func (m *MultiMap) KeySet() []interface{} {
	keys := make([]interface{}, len(m.m))
	count := 0
	for key := range m.m {
		keys[count] = key
		count++
	}
	return keys
}
104361
func (c *PoolInfoCache) Set(hash chainhash.Hash, p *apitypes.TicketPoolInfo) {
	c.mtx.Lock()
	defer c.mtx.Unlock()
	c.poolInfo[hash] = p
	if len(c.expireQueue)+1 >= c.maxSize {
		expireHash := c.expireQueue[0]
		c.expireQueue = c.expireQueue[1:]
		delete(c.poolInfo, expireHash)
	}
	c.expireQueue = append(c.expireQueue, hash)
}
612115
func (r *RedisStore) MGet(keys []string) (map[string]interface{}, error) {
	values, err := r.client.MGet(keys...).Result()

	newValues := make(map[string]interface{}, len(keys))

	for k, v := range keys {
		value := values[k]
		if err != nil {
			return nil, err
		}

		newValues[v] = value
	}
	return newValues, nil
}
875868
func (ch *CredHub) SetSSH(name string, value values.SSH) (credentials.SSH, error) {
	var cred credentials.SSH
	err := ch.setCredential(name, "ssh", value, &cred)

	return cred, err
}
659642
func (v *StringMap) Set(name, value string) {
	v.mu.Lock()
	v.values[name] = value
	v.mu.Unlock()
}
1072659
func (ctx *Context) Set(key, value string) {
	ctx.SetHeader(key, value)
}
682304
func (h *Header) Set(key string, value interface{}) error {
	switch key {
	case "alg":
		var v jwa.KeyEncryptionAlgorithm
		s, ok := value.(string)
		if ok {
			v = jwa.KeyEncryptionAlgorithm(s)
		} else {
			v, ok = value.(jwa.KeyEncryptionAlgorithm)
			if !ok {
				return errors.Wrap(ErrInvalidHeaderValue, "invalid header value for 'alg'")
			}
		}
		h.Algorithm = v
	case "apu":
		var v buffer.Buffer
		switch value.(type) {
		case buffer.Buffer:
			v = value.(buffer.Buffer)
		case []byte:
			v = buffer.Buffer(value.([]byte))
		case string:
			v = buffer.Buffer(value.(string))
		default:
			return errors.Wrap(ErrInvalidHeaderValue, "invalid header value for 'apu'")
		}
		h.AgreementPartyUInfo = v
	case "apv":
		var v buffer.Buffer
		switch value.(type) {
		case buffer.Buffer:
			v = value.(buffer.Buffer)
		case []byte:
			v = buffer.Buffer(value.([]byte))
		case string:
			v = buffer.Buffer(value.(string))
		default:
			return errors.Wrap(ErrInvalidHeaderValue, "invalid header value for 'apv'")
		}
		h.AgreementPartyVInfo = v
	case "enc":
		var v jwa.ContentEncryptionAlgorithm
		s, ok := value.(string)
		if ok {
			v = jwa.ContentEncryptionAlgorithm(s)
		} else {
			v, ok = value.(jwa.ContentEncryptionAlgorithm)
			if !ok {
				return errors.Wrap(ErrInvalidHeaderValue, "invalid header value for 'enc'")
			}
		}
		h.ContentEncryption = v
	case "cty":
		v, ok := value.(string)
		if !ok {
			return errors.Wrap(ErrInvalidHeaderValue, "invalid header value for 'cty'")
		}
		h.ContentType = v
	case "epk":
		v, ok := value.(*jwk.ECDSAPublicKey)
		if !ok {
			return errors.Wrap(ErrInvalidHeaderValue, "invalid header value for 'epk'")
		}
		h.EphemeralPublicKey = v
	case "kid":
		v, ok := value.(string)
		if !ok {
			return errors.Wrap(ErrInvalidHeaderValue, "invalid header value for 'kid'")
		}
		h.KeyID = v
	case "typ":
		v, ok := value.(string)
		if !ok {
			return errors.Wrap(ErrInvalidHeaderValue, "invalid header value for 'typ'")
		}
		h.Type = v
	case "x5t":
		v, ok := value.(string)
		if !ok {
			return errors.Wrap(ErrInvalidHeaderValue, "invalid header value for 'x5t'")
		}
		h.X509CertThumbprint = v
	case "x5t#256":
		v, ok := value.(string)
		if !ok {
			return errors.Wrap(ErrInvalidHeaderValue, "invalid header value for 'x5t#256'")
		}
		h.X509CertThumbprintS256 = v
	case "x5c":
		v, ok := value.([]string)
		if !ok {
			return errors.Wrap(ErrInvalidHeaderValue, "invalid header value for 'x5c'")
		}
		h.X509CertChain = v
	case "crit":
		v, ok := value.([]string)
		if !ok {
			return errors.Wrap(ErrInvalidHeaderValue, "invalid header value for 'crit'")
		}
		h.Critical = v
	case "jku":
		v, ok := value.(string)
		if !ok {
			return errors.Wrap(ErrInvalidHeaderValue, "invalid header value for 'jku'")
		}
		u, err := url.Parse(v)
		if err != nil {
			return errors.Wrap(errors.Wrap(err, "failed to parse new value for 'jku' header"), "invalid header value")
		}
		h.JwkSetURL = u
	case "x5u":
		v, ok := value.(string)
		if !ok {
			return errors.Wrap(ErrInvalidHeaderValue, "invalid header value for 'x5u'")
		}
		u, err := url.Parse(v)
		if err != nil {
			return errors.Wrap(errors.Wrap(err, "failed to parse new value for 'x5u' header"), "invalid header value")
		}
		h.X509Url = u
	default:
		h.PrivateParams[key] = value
	}
	return nil
}
711247
func (u *utxoStore) Set(txHash string, txIndex uint32, addrs []string, val int64) {
	u.Lock()
	defer u.Unlock()
	u.set(txHash, txIndex, addrs, val)
}
312712
func (s setMap) Set(key string, value interface{}) {
	if reflect.ValueOf(value).IsNil() {
		return
	}

	s[key] = value
}
550779
func (s *GetXssMatchSetOutput) SetXssMatchSet(v *XssMatchSet) *GetXssMatchSetOutput {
	s.XssMatchSet = v
	return s
}
141243
func (m ConcurrentMap) Set(key string, value interface{}) {
	// Get map shard.
	shard := m.GetShard(key)
	shard.Lock()
	shard.items[key] = value
	shard.Unlock()
}
247790
func (fi *FastIntegerHashMap) Set(key, value uint64) {
	if float64(fi.count+1)/float64(len(fi.packets)) > ratio {
		fi.rebuild()
	}

	fi.packets.set(&packet{key: key, value: value})
	fi.count++
}
1069113
func (c *syncClient) Hset(arg0 string, arg1 string, arg2 []byte) (err Error) {
	arg0bytes := []byte(arg0)
	arg1bytes := []byte(arg1)
	arg2bytes := arg2

	_, err = c.conn.ServiceRequest(&HSET, [][]byte{arg0bytes, arg1bytes, arg2bytes})
	return
}
1192623
func (u *User) Set(key string, value interface{}) {
	// Get map shard.
	u.Lock()
	defer u.Unlock()
	u.data[key] = value
}
1253370
func (t *TxStructure) HSet(key []byte, field []byte, value []byte) error {
	if t.readWriter == nil {
		return errWriteOnSnapshot
	}
	return t.updateHash(key, field, func([]byte) ([]byte, error) {
		return value, nil
	})
}
555886
func (r *Redis) HMSet(key string, pairs map[string]string) error {
	args := packArgs("HMSET", key, pairs)
	rp, err := r.ExecuteCommand(args...)
	if err != nil {
		return err
	}
	return rp.OKValue()
}