// Set acquires the write lock and sets all the fields in ActiveDevice.
// The acct parameter is not used for anything except to help ensure
// that this is called from inside a LoginState account request.
5132
func (a *ActiveDevice) Set(m MetaContext, uv keybase1.UserVersion, deviceID keybase1.DeviceID,
	sigKey, encKey GenericKey, deviceName string, deviceCtime keybase1.Time) error {
	a.Lock()
	defer a.Unlock()

	if err := a.internalUpdateUserVersionDeviceID(uv, deviceID); err != nil {
		return err
	}

	a.signingKey = sigKey
	a.encryptionKey = encKey
	a.deviceName = deviceName
	a.deviceCtime = deviceCtime
	a.nistFactory = NewNISTFactory(m.G(), uv.Uid, deviceID, sigKey)
	a.secretSyncer = NewSecretSyncer(m.G())

	return nil
}
347790
func Set(service, user, password string) error {
	return provider.Set(service, user, password)
}
742893
func (a *segment) Set(key, val []byte) error {
	return a.mutate(OperationSet, key, val)
}
99807
func (a MultiStatsClient) Set(name string, value string, rate float64) {
	for _, c := range a {
		c.Set(name, value, rate)
	}
}
970905
func (opt *ThrottledeviceOpt) Set(val string) error {
	var value *blkiodev.ThrottleDevice
	if opt.validator != nil {
		v, err := opt.validator(val)
		if err != nil {
			return err
		}
		value = v
	}
	(opt.values) = append((opt.values), value)
	return nil
}
393522
func (s *String) Set(val string) error {
	*s = String(val)
	return nil
}
1141194
func (s *InstanceState) Set(from *InstanceState) {
	s.Lock()
	defer s.Unlock()

	from.Lock()
	defer from.Unlock()

	s.ID = from.ID
	s.Attributes = from.Attributes
	s.Ephemeral = from.Ephemeral
	s.Meta = from.Meta
	s.Tainted = from.Tainted
}
768618
func (s *Store) Set(ctx context.Context, name string, sec store.Secret) error {
	d := sec.Data()
	if d == nil {
		d = make(map[string]interface{}, 1)
	}
	d[passwordKey] = sec.Password()
	_, err := s.api.Logical().Write(path.Join(s.path, name), d)
	return err
}
477883
func (c *Config) Set(key, value string) error {
	data, err := load(c.filename, c.passphrase)
	if err != nil {
		return errors.Wrapf(err, "failed to read secrects config %s: %s", c.filename, err)
	}

	old := data[key]
	if value == old {
		return nil
	}

	data[key] = value
	return save(c.filename, c.passphrase, data)
}
872158
func (m *MemoryStorer) Set(key, value string) error {
	m.mut.Lock()
	m.sessions[key] = memorySession{
		expires: time.Now().UTC().Add(m.maxAge),
		value:   value,
	}
	m.mut.Unlock()

	return nil
}
192688
func (m *InMem) Set(ctx context.Context, name string, value []byte) error {
	m.Lock()
	defer m.Unlock()

	m.data[name] = value
	return nil
}
377059
func (c *InMemoryCache) Set(_ context.Context, key Key, value Thunk) {
	c.mu.Lock()
	c.items[key.String()] = value
	c.mu.Unlock()
}
319563
func (s *SyncString) Set(v string) {
	s.Lock()
	defer s.Unlock()
	s.string = v
}
1115030
func (i *Uint64) Set(value uint64) {
	i.lock.Lock()
	defer i.lock.Unlock()
	i.increment = value
}
35520
func (m *MDBStore) Set(key []byte, val []byte) error {
	// Start write txn
	tx, dbis, err := m.startTxn(false, dbConf)
	if err != nil {
		return err
	}

	if err := tx.Put(dbis[0], key, val, 0); err != nil {
		tx.Abort()
		return err
	}
	return tx.Commit()
}
1344573
func (i *Uint16Flags) Set(value string) error {
	v, err := strconv.Atoi(value)
	if err != nil {
		return err
	}
	*i = append(*i, uint16(v))
	return nil
}
1279105
func (s *session) Set(sessionType apitypes.SessionType, identity, auth envelope.Envelope,
	passphrase []byte, token []byte) error {
	s.mutex.Lock()
	defer s.mutex.Unlock()

	err := checkSessionType(sessionType, identity, auth)
	if err != nil {
		return err
	}

	if len(passphrase) == 0 {
		return errors.New("Passphrase must not be empty")
	}

	if len(token) == 0 && sessionType == apitypes.UserSession {
		return errors.New("Token must not be empty")
	}

	s.sessionType = sessionType
	s.passphrase, err = s.guard.Secret(passphrase)
	if err != nil {
		return err
	}

	s.token, err = s.guard.Secret(token)
	if err != nil {
		return err
	}

	s.identity = identity
	s.auth = auth

	return nil
}