// Set sets the currently logged-in user. This is typically used by middleware
// that handles user authentication.
964469
func Set(c *context.Context, u *User) {
	c.Values.Set(userKey, u)
}
319563
func (s *SyncString) Set(v string) {
	s.Lock()
	defer s.Unlock()
	s.string = v
}
1316413
func (r *Role) Set(v string) error {
	val := Role(strings.Title(v))
	if err := val.Check(); err != nil {
		return trace.Wrap(err)
	}
	*r = val
	return nil
}
537590
func (self Object) Set(name string, value interface{}) error {
	{
		value, err := self.object.runtime.safeToValue(value)
		if err != nil {
			return err
		}
		err = catchPanic(func() {
			self.object.put(name, value, true)
		})
		return err
	}
}
729743
func (db *Database) Set(sid string, lifetime sessions.LifeTime, key string, value interface{}, immutable bool) {
	valueBytes, err := sessions.DefaultTranscoder.Marshal(value)
	if err != nil {
		return
	}

	db.redis.Set(makeKey(sid, key), valueBytes, int64(lifetime.DurationUntilExpiration().Seconds()))
}
104610
func (b *BearerJWT) Set(r *http.Request) error {
	if b.SharedSecret != "" && b.Username != "" {
		token, err := b.Token(b.Username)
		if err != nil {
			return fmt.Errorf("unable to create token")
		}
		r.Header.Set("Authorization", "Bearer "+token)
	}
	return nil
}
1371907
func (l *ShardedNoTS) Set(tenantID, key string, val interface{}) error {
	_, ok := l.cache[tenantID]
	if !ok {
		l.cache[tenantID] = l.constructor()
		l.itemCount[tenantID] = 0
	}

	l.itemCount[tenantID]++
	return l.cache[tenantID].Set(key, val)
}
1026136
func (self *Nameservers) Set(domainName string, nameservers []string) (*operation.OperationInfo, error) {
	var res map[string]interface{}
	params := []interface{}{self.Key, domainName, nameservers}
	if err := self.Call("domain.nameservers.set", params, &res); err != nil {
		return nil, err
	}
	return operation.ToOperationInfo(res), nil
}
531610
func (db *Database) Set(sid string, lifetime sessions.LifeTime, key string, value interface{}, immutable bool) {
	valueBytes, err := sessions.DefaultTranscoder.Marshal(value)
	if err != nil {
		golog.Error(err)
		return
	}

	err = db.Service.Update(func(txn *badger.Txn) error {
		dur := lifetime.DurationUntilExpiration()
		return txn.SetWithTTL(makeKey(sid, key), valueBytes, dur)
	})

	if err != nil {
		golog.Error(err)
	}
}
543322
func (fb *Firebase) Set(v interface{}) error {
	bytes, err := json.Marshal(v)
	if err != nil {
		return err
	}
	_, _, err = fb.doRequest("PUT", bytes)
	return err
}
962333
func (c *Cookies) Set(key, value string) {
	c.Mu.Lock()
	if c.Storage == nil {
		c.Storage = make(map[string]string, zero)
	}
	c.Storage[key] = value
	c.Mu.Unlock()
}
743637
func (ip *Interpreter) set(args []string) {
	ip.simpleResponder(ip.Backend.SetUserData(args[0], args[1], args[2]))
}
1354656
func Set(key, value string) p.Plugin {
	return p.NewRequestPlugin(func(ctx *c.Context, h c.Handler) {
		cookie := &http.Cookie{Name: key, Value: value}
		ctx.Request.AddCookie(cookie)
		h.Next(ctx)
	})
}
1164442
func (r *GroupPercentService) Set(appId string, id string, grouppercent *GroupPercent) *GroupPercentSetCall {
	c := &GroupPercentSetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.appId = appId
	c.id = id
	c.grouppercent = grouppercent
	return c
}
12304
func (scope *Scope) Set(name string, value interface{}) *Scope {
	scope.db.InstantSet(name, value)
	return scope
}
884124
func (db *Database) Set(sid string, lifetime sessions.LifeTime, key string, value interface{}, immutable bool) {
	valueBytes, err := sessions.DefaultTranscoder.Marshal(value)
	if err != nil {
		golog.Debug(err)
		return
	}

	err = db.Service.Update(func(tx *bolt.Tx) error {
		b := db.getBucketForSession(tx, sid)
		if b == nil {
			return nil
		}

		// Author's notes:
		// expiration is handlded by the session manager for the whole session, so the `db.Destroy` will be called when and if needed.
		// Therefore we don't have to implement a TTL here, but we need a `db.Cleanup`, as we did previously, method to delete any expired if server restarted
		// (badger does not need a `Cleanup` because we set the TTL based on the lifetime.DurationUntilExpiration()).
		return b.Put(makeKey(key), valueBytes)
	})

	if err != nil {
		golog.Debug(err)
	}
}
588721
func (r *RequestContext) Set(key string, value interface{}) {
	r.mutex.Lock()
	r.store[key] = value
	r.mutex.Unlock()
}