// Set stores stores user and pass in the keyring under the defined service
// name.
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()
}
409096
func (p *Secring) Set(pk *PrivateKey) error {
	if !pk.Encrypted {
		return fmt.Errorf("private key must be encrypted")
	}

	p.Lock()
	defer p.Unlock()

	p.insert(secKRToPB(pk))
	return nil
}
899110
func (j *Json) Set(key string, val interface{}) {
	m, err := j.Map()
	if err != nil {
		return
	}
	m[key] = val
}
1040626
func (c standardConfigManager) Set(key string, value []byte) error {
	err := c.store.Set(key, value)
	return err
}
1372329
func (c configManager) Set(key string, value []byte) error {
	encodedValue, err := secconf.Encode(value, bytes.NewBuffer(c.keystore))
	if err == nil {
		err = c.store.Set(key, encodedValue)
	}
	return err
}
842357
func (s *Store) Set(ctx context.Context, name string, value []byte) error {
	name = s.prefix + name
	out.Debug(ctx, "consul.Set(%s)", name)
	p := &api.KVPair{
		Key:   name,
		Value: value,
	}
	_, err := s.api.KV().Put(p, nil)
	return err
}
659642
func (v *StringMap) Set(name, value string) {
	v.mu.Lock()
	v.values[name] = value
	v.mu.Unlock()
}
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
}
1361540
func (c *JSONConfigContainer) Set(key, val string) error {
	c.Lock()
	defer c.Unlock()
	c.data[key] = val
	return nil
}
366276
func (h *multiHandler) Set(key string, value interface{}, args ...interface{}) error {
	lengthArgs := len(args)
	if lengthArgs > 0 && !h.Args() {
		return cfg.ErrArgsNotSupported
	}

	for _, handler := range h.handlers {
		switch {
		case lengthArgs != 0 && handler.Args():
			if err := handler.Set(key, value, args...); err == nil {
				return nil
			}
		default:
			if err := handler.Set(key, value); err == nil {
				return nil
			}
		}

	}
	return cfg.ErrKeyNotSet
}
433402
func (context *BaseContext) Set(key string, value interface{}) {
	context.userData[key] = value
}
1284904
func (c *Conn) Set(key string, value []byte) error {
	code, body, err := c.doREST("PUT", key, value)
	if err != nil {
		return err
	}
	if code != 201 {
		return &Error{string(body), code}
	}

	return nil
}
802362
func (s *Settings) Set(key string, value interface{}) {
	s.core[key] = value
}
912499
func (d *ResourceData) Set(key string, value interface{}) error {
	d.once.Do(d.init)

	// If the value is a pointer to a non-struct, get its value and
	// use that. This allows Set to take a pointer to primitives to
	// simplify the interface.
	reflectVal := reflect.ValueOf(value)
	if reflectVal.Kind() == reflect.Ptr {
		if reflectVal.IsNil() {
			// If the pointer is nil, then the value is just nil
			value = nil
		} else {
			// Otherwise, we dereference the pointer as long as its not
			// a pointer to a struct, since struct pointers are allowed.
			reflectVal = reflect.Indirect(reflectVal)
			if reflectVal.Kind() != reflect.Struct {
				value = reflectVal.Interface()
			}
		}
	}

	err := d.setWriter.WriteField(strings.Split(key, "."), value)
	if err != nil && d.panicOnError {
		panic(err)
	}
	return err
}
677948
func (h *byNameHandler) Set(key string, value interface{}, args ...interface{}) error {
	switch length := len(args); length {
	case 0:
		return cfg.ErrBadArgs
	default:
		handler, err := h.getNamedHandler(args[0])
		switch {
		case err != nil:
			return err
		case length == 1:
			return handler.Set(key, value)
		default:
			otherArgs := args[1:]
			return handler.Set(key, value, otherArgs...)
		}
	}
}
714880
func (s *PostgresStore) Set(key, value interface{}) error {
	s.lock.Lock()
	defer s.lock.Unlock()

	s.data[key] = value
	return nil
}
224371
func (c *Func) Set(key string, image *imageserver.Image, params imageserver.Params) error {
	return c.SetFunc(key, image, params)
}