// Put sets the value for a key.
483476
func (kv *KV) Put(key, value []byte) error {
	return kv.db.Write(gkv.Btos(key), value)
}
231358
func (m *MultiMap) Put(key interface{}, value interface{}) {
	set, found := m.m[key]
	if found {
		set[value] = exists
		m.m[key] = set
	} else {
		set = make(Set)
		set[value] = exists
		m.m[key] = set
	}
}
686807
func (vs *ValueMap) Put(k, v Value) {
	if vs == nil {
		panic("put on nil value map")
	}
	vs.hashMap.Put(k, v)
}
1073308
func (t *table) Put(key []byte, value []byte) error {
	return t.db.Put(append([]byte(t.prefix), key...), value)
}
138865
func (s *AESEncryptedStorage) Put(key, value string) {
	if len(key) == 0 {
		return
	}
	data, err := s.readEncryptedStorage()
	if err != nil {
		log.Warn("Failed to read encrypted storage", "err", err, "file", s.filename)
		return
	}
	ciphertext, iv, err := encrypt(s.key, []byte(value), []byte(key))
	if err != nil {
		log.Warn("Failed to encrypt entry", "err", err)
		return
	}
	encrypted := storedCredential{Iv: iv, CipherText: ciphertext}
	data[key] = encrypted
	if err = s.writeEncryptedStorage(data); err != nil {
		log.Warn("Failed to write entry", "err", err)
	}
}
444706
func (d *Datastore) Put(key ds.Key, value []byte) (err error) {
	return d.child.Put(d.ConvertKey(key), value)
}
843806
func (c *Config) Put(key string, value interface{}) (changed bool) {
	return c.PutKey(c.NewKey(key), value)
}
1295355
func (b *Backend) Put(ctx context.Context, entry *physical.Entry) error {
	defer metrics.MeasureSince(metricPut, time.Now())

	// Pooling
	b.permitPool.Acquire()
	defer b.permitPool.Release()

	// Insert
	m := spanner.InsertOrUpdateMap(b.table, map[string]interface{}{
		"Key":   entry.Key,
		"Value": entry.Value,
	})
	if _, err := b.client.Apply(ctx, []*spanner.Mutation{m}); err != nil {
		return errwrap.Wrapf("failed to put data: {{err}}", err)
	}
	return nil
}
100749
func (batch *UpdateBatch) Put(ns string, key string, value []byte, version *version.Height) {
	batch.PutValAndMetadata(ns, key, value, nil, version)
}
1033595
func (k *KeyValueStringSlice) Put(key, value string) {
	for i, storedKey := range k.Keys {
		if storedKey == key {
			k.Values[i] = value
			return
		}
	}
	k.Keys = append(k.Keys, key)
	k.Values = append(k.Values, value)
}
709373
func (p *Plugin) Put(key string, data proto.Message, opts ...datasync.PutOption) error {
	if !p.isKvEnabled() {
		return nil
	}

	if p.adapter != nil {
		return p.adapter.db.Put(key, data, opts...)
	}

	return ErrNotReady
}
1171410
func (txn *ProtoTxn) Put(key string, data proto.Message) keyval.ProtoTxn {
	txn.access.Lock()
	defer txn.access.Unlock()

	txn.items[key] = &protoTxnItem{data: data}

	return txn
}
553294
func (c *Container) Put(key, value interface{}) {

	for k := 0; k < c.length; k++ {
		if equal(c.items[k].Key, key) {
			c.items[k].Value = value
			return
		}
	}
	if c.length == num {
		if c.next == nil {
			if c.pool != nil {
				c.next = c.pool.Get().(*Container)
			} else {
				c.next = New()
			}

		}
		c.next.Put(key, value)
		return
	}
	c.items[c.length] = item{key, value}
	c.length++
	return
}
596598
func (n *NodeStore) Put(key []byte, data []byte) error {
	return n.store.Put(n.addr, key, data)
}
758130
func (c *Client) Put() {
	select {
	case b := <-c.sent:
		c.p.ch <- b
	default:
	}
}
621006
func (s *MockStore) Put(key string, value []byte, options *store.WriteOptions) error {
	mData := s.db[key]
	if mData == nil {
		mData = &MockData{value, 0}
	}
	mData.Index = mData.Index + 1
	s.db[key] = mData
	return nil
}
1198777
func (db *NodeSet) Put(key []byte, value []byte) error {
	db.lock.Lock()
	defer db.lock.Unlock()

	if _, ok := db.nodes[string(key)]; ok {
		return nil
	}
	keystr := string(key)

	db.nodes[keystr] = common.CopyBytes(value)
	db.order = append(db.order, keystr)
	db.dataSize += len(value)

	return nil
}