// Set adds the basic auth headers to the request
347340
func (b *BasicAuth) Set(r *http.Request) error {
	r.SetBasicAuth(b.Username, b.Password)
	return nil
}
912953
func (n *ACName) Set(s string) error {
	nn, err := NewACName(s)
	if err == nil {
		*n = *nn
	}
	return err
}
665166
func Set(c *client.Client, app string, config api.Config) (api.Config, error) {
	body, err := json.Marshal(config)

	if err != nil {
		return api.Config{}, err
	}

	u := fmt.Sprintf("/v1/apps/%s/config/", app)

	resBody, err := c.BasicRequest("POST", u, body)

	if err != nil {
		return api.Config{}, err
	}

	newConfig := api.Config{}
	if err = json.Unmarshal([]byte(resBody), &newConfig); err != nil {
		return api.Config{}, err
	}

	return newConfig, nil
}
528867
func (a *auther) setRequestAuthHeader(req *http.Request, accessToken *Token) error {
	oauthParams := a.commonOAuthParams()
	oauthParams[oauthTokenParam] = accessToken.Token
	params, err := collectParameters(req, oauthParams)
	if err != nil {
		return err
	}
	signatureBase := signatureBase(req, params)
	signature, err := a.signer().Sign(accessToken.TokenSecret, signatureBase)
	if err != nil {
		return err
	}
	oauthParams[oauthSignatureParam] = signature
	req.Header.Set(authorizationHeaderParam, authHeaderValue(oauthParams))
	return nil
}
1192623
func (u *User) Set(key string, value interface{}) {
	// Get map shard.
	u.Lock()
	defer u.Unlock()
	u.data[key] = value
}
724526
func (ec *Cache) Set(k string, v interface{}, size uint64, expire int32) {
	ec.Lock()
	ec.actualSet(k, v, size, expire)
	ec.Unlock()
}
463398
func (s *RedisKVStore) Set(key string, value string) error {
	if !strings.HasPrefix(key, s.prefix) {
		key = s.prefix + key
	}
	return s.client.Set(key, value, 0).Err()
}
1295966
func (a *NetworkAddresses) Set(s string) error {
	for _, t := range strings.Split(s, ",") {
		_, _, err := net.SplitHostPort(t)
		if err != nil {
			return err
		}

		*a = append(*a, t)
	}

	return nil
}
788723
func (u *Uint64) Set(s string) error {
	v, err := strconv.ParseUint(s, 0, 64)
	*u = Uint64(v)
	return err
}
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
}
718080
func (c *attrCache) Set(id uint64, attrs map[string]interface{}) {
	c.mu.Lock()
	defer c.mu.Unlock()
	c.attrs[id] = attrs
}
737397
func (hs *Headers) Set(name string, value Value) {
	var i int
	for ; i < len(*hs); i++ {
		if (*hs)[i].Name == name {
			(*hs)[i].Value = value
			return
		}
	}

	*hs = append(*hs, Header{
		Name: name, Value: value,
	})
}
625960
func (t *Token) SetAuthHeader(r *http.Request) {
	r.Header.Set("Authorization", t.Type()+" "+t.AccessToken)
}
137671
func (c *Client) Set(name string, value string, tags []string, rate float64) error {
	return c.send(name, value, setSuffix, tags, rate)
}
184042
func (k windowsKeychain) Set(service, username, password string) error {
	cred := wincred.NewGenericCredential(k.credName(service, username))
	cred.UserName = username
	cred.CredentialBlob = []byte(password)
	return cred.Write()
}
62699
func Set(name string) p.Plugin {
	return p.NewRequestPlugin(func(ctx *c.Context, h c.Handler) {
		defineType(name, ctx.Request)
		h.Next(ctx)
	})
}
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)
}