// Delete deletes item by key, returns NotFound error
// if item does not exist
437803
func (m *Memory) Delete(ctx context.Context, key []byte) error {
	if len(key) == 0 {
		return trace.BadParameter("missing parameter key")
	}
	m.Lock()
	defer m.Unlock()
	m.removeExpired()
	if m.tree.Get(&btreeItem{Item: backend.Item{Key: key}}) == nil {
		return trace.NotFound("key %q is not found", string(key))
	}
	event := backend.Event{
		Type: backend.OpDelete,
		Item: backend.Item{
			Key: key,
		},
	}
	m.processEvent(event)
	if !m.EventsOff {
		m.buf.Push(event)
	}
	return nil
}
1287350
func (s Byte) Delete(items ...byte) {
	for _, item := range items {
		delete(s, item)
	}
}
648141
func (db *DB) Delete(key []byte, wo *opt.WriteOptions) error {
	return db.putRec(keyTypeDel, key, nil, wo)
}
817322
func (b *Bucket) Delete(key []byte) error {
	err := b.bucket.Delete(key)
	if err == bolt.ErrTxNotWritable {
		return kv.ErrTxNotWritable
	}
	return err
}
860382
func (table *RegommendTable) Delete(key interface{}) (*RegommendItem, error) {
	table.RLock()
	r, ok := table.items[key]
	if !ok {
		table.RUnlock()
		return nil, errors.New("Key not found in engine")
	}

	// engine value so we don't keep blocking the mutex.
	aboutToDeleteItem := table.aboutToDeleteItem
	table.RUnlock()

	// Trigger callbacks before deleting an item from engine.
	if aboutToDeleteItem != nil {
		aboutToDeleteItem(r)
	}

	r.RLock()
	defer r.RUnlock()

	table.Lock()
	defer table.Unlock()
	delete(table.items, key)

	return r, nil
}
695975
func (c *NodbCacher) Delete(key string) error {
	_, err := c.db.Del([]byte(key))
	return err
}
20536
func (l *LRUNoTS) Delete(key string) error {
	res, err := l.cache.Get(key)
	if err != nil && err != ErrNotFound {
		return err
	}

	// item already deleted
	if err == ErrNotFound {
		// surpress not found errors
		return nil
	}

	elem := res.(*list.Element)

	return l.removeElem(elem)
}
417927
func (c *TwoTier) Delete(key string) {
	c.second.Delete(key)
	c.first.Delete(key)
}
249141
func (s Int64) Delete(items ...int64) {
	for _, item := range items {
		delete(s, item)
	}
}
611018
func (s *RankedSet) Delete(item Item) Item {
	key := item.Key()
	value, ok := s.set[key]
	if !ok {
		return nil
	}

	s.rank.Delete(value) // should always return the same data as value (non-nil)
	delete(s.set, key)

	return value.item
}
1218182
func (s Int32) Delete(items ...int32) {
	for _, item := range items {
		delete(s, item)
	}
}
158428
func (f *fileStorage) Delete(key string) error {
	return os.Remove(f.filePathToFile(key))
}
695591
func (s String) Delete(items ...string) {
	for _, item := range items {
		delete(s, item)
	}
}
630037
func (mem *memNamedMapping) Delete(name string) (value interface{}, found bool) {
	item, found := mem.removeNameIdxSync(name)
	if found {
		mem.publishDelToChannel(name, item.value)
		return item.value, found
	}
	return nil, false
}
1042330
func (k *ArrayKeyring) Remove(key string) error {
	delete(k.items, key)
	return nil
}
1021320
func (c *Collection) Delete(i gtreap.Item) {
	c.assertNotReadOnly()

	c.rootLock.Lock()
	c.root = c.root.Delete(i)
	c.rootLock.Unlock()
}
545821
func (c *MemoryCache) Delete(key string) {
	c.mu.Lock()
	delete(c.items, key)
	c.mu.Unlock()
}