// Put sets the value at the provided key.
771771
func (b *Bucket) Put(key []byte, value []byte) error {
	err := b.bucket.Put(key, value)
	if err == bolt.ErrTxNotWritable {
		return kv.ErrTxNotWritable
	}
	return err
}
843096
func (k *KV) Put(p *KVPair, q *WriteOptions) (*WriteMeta, error) {
	params := make(map[string]string, 1)
	if p.Flags != 0 {
		params["flags"] = strconv.FormatUint(p.Flags, 10)
	}
	_, wm, err := k.put(p.Key, params, p.Value, q)
	return wm, err
}
1295920
func Put(store string, key string, value []byte, oldVal []byte) int {

	existingVal, casIndex, ok := Get(store, key)

	if ok && !bytes.Equal(oldVal, existingVal) {
		return OUTDATED
	}

	url := CONSUL_KV_BASE_URL + store + "/" + key + "?cas=" + strconv.Itoa(casIndex)
	//glog.Infof("Updating KV pair for %s %s %s %d", url, key, value, casIndex)

	req, err := http.NewRequest("PUT", url, bytes.NewBuffer(value))

	client := &http.Client{}
	resp, err := client.Do(req)

	if err != nil {
		glog.Errorf("Error creating KV pair for %s", key)
		return ERROR
	}

	defer resp.Body.Close()

	body, _ := ioutil.ReadAll(resp.Body)

	if string(body) == "false" {
		return ERROR
	}

	return OK

}
474568
func (c *Cache) Put(ctx context.Context, key storage.CacheKey, val []byte, exp time.Duration) {
	c.mu.Lock()
	defer c.mu.Unlock()

	if c.cacheMap == nil {
		c.cacheMap = make(map[storage.CacheKey][]byte)
	}

	c.cacheMap[key] = val
}
415859
func (om *OrdMap) Put(key, val interface{}) {
	rkey := ty.AssertType(key, om.ktype)
	rval := ty.AssertType(val, om.vtype)
	if !om.exists(rkey) {
		om.keys = reflect.Append(om.keys, rkey)
	}
	om.m.SetMapIndex(rkey, rval)
}
418591
func (m *SyncIdentityMap) Put(key interface{}, value interface{}) {
	m.Lock()
	keyPtr := genKey(key)
	m.m[keyPtr] = value
	m.Unlock()
}
483476
func (kv *KV) Put(key, value []byte) error {
	return kv.db.Write(gkv.Btos(key), value)
}
87722
func (dbInst *DB) Put(key []byte, value []byte, sync bool) error {
	wo := dbInst.writeOptsNoSync
	if sync {
		wo = dbInst.writeOptsSync
	}
	err := dbInst.db.Put(key, value, wo)
	if err != nil {
		logger.Errorf("Error writing leveldb key [%#v]", key)
		return errors.Wrapf(err, "error writing leveldb key [%#v]", key)
	}
	return nil
}
758130
func (c *Client) Put() {
	select {
	case b := <-c.sent:
		c.p.ch <- b
	default:
	}
}
26659
func (ng *memAutoCertCache) Put(ctx context.Context, key string, data []byte) error {
	ng.mtx.Lock()
	defer ng.mtx.Unlock()
	ng.kv[key] = data
	return nil
}
424077
func (m *MultiMap) Put(key interface{}, value interface{}) {
	m.m[key] = append(m.m[key], value)
}
372589
func (wb *WriteBatch) Put(key, value []byte) {
	cKey := byteToChar(key)
	cValue := byteToChar(value)
	C.rocksdb_writebatch_put(wb.c, cKey, C.size_t(len(key)), cValue, C.size_t(len(value)))
}
1316786
func (kv *KV) Put(key, value []byte) error {
	return kv.db.Put(key, value, nil)
}
885203
func (s *DBStore) Put(key string, i interface{}) (err error) {
	var bytes []byte
	if marshaler, ok := i.(encoding.BinaryMarshaler); ok {
		if bytes, err = marshaler.MarshalBinary(); err != nil {
			return err
		}
	} else {
		if bytes, err = json.Marshal(i); err != nil {
			return err
		}
	}
	return s.db.Put([]byte(key), bytes, nil)
}
843806
func (c *Config) Put(key string, value interface{}) (changed bool) {
	return c.PutKey(c.NewKey(key), value)
}
959346
func (s *storeImpl) Put(ctx datastore.Context, properties *StoredProperties) error {
	return s.ds.Put(ctx, Key(propsID), properties)
}
1148353
func (database *Database) Put(key string, value interface{}) {
	database.db.Put(key, value)
}