// Delete will delete the rule from the local cache or the system.
160080
func (b *BatchProvider) Delete(table, chain string, rulespec ...string) error {

	b.Lock()
	defer b.Unlock()

	if _, ok := b.batchTables[table]; !ok {
		return b.ipt.Delete(table, chain, rulespec...)
	}

	if _, ok := b.rules[table]; !ok {
		return nil
	}
	if _, ok := b.rules[table][chain]; !ok {
		return nil
	}

	rule := strings.Join(rulespec, " ")

	for index, r := range b.rules[table][chain] {
		if rule == r {
			switch index {
			case 0:
				if len(b.rules[table][chain]) == 1 {
					b.rules[table][chain] = []string{}
				} else {
					b.rules[table][chain] = b.rules[table][chain][1:]
				}
			case len(b.rules[table][chain]) - 1:
				b.rules[table][chain] = b.rules[table][chain][:index]
			default:
				b.rules[table][chain] = append(b.rules[table][chain][:index], b.rules[table][chain][index+1:]...)
			}
			break
		}
	}

	return nil
}
923473
func (s *DBStore) Delete(key string) (err error) {
	return s.db.Delete([]byte(key), nil)
}
70366
func (c *Cache) Delete(appname, path string) {
	if ele, hit := c.cache[appname+path]; hit {
		c.removeElement(ele)
	}
}
184875
func (c *Cache) Delete(key string) {
	key = keyToFilename(key)
	c.d.Erase(key)
}
1323916
func (db *DB) Delete(key []byte) (err error) {
	err = db.ldb.Delete(key, nil)
	if err != nil {
		metrics.GetOrRegisterCounter("DB.deleteFail", nil).Inc(1)
		return err
	}
	metrics.GetOrRegisterCounter("DB.delete", nil).Inc(1)
	return nil
}
798813
func (m *Manager) Delete(key string) error {
	config, err := m.GetByKey(key)

	if err != nil {
		return err
	}

	return m.collection.Remove(config)
}
635387
func (c *Cacher) Delete(key string, recursive bool) []string {
	c.mu.Lock()
	defer c.mu.Unlock()
	var keys []string

	if recursive {
		for k := range c.data {
			if strings.HasPrefix(k, key) {
				delete(c.data, k)
				keys = append(keys, k)
			}
		}
	} else {
		if _, ok := c.data[key]; ok {
			delete(c.data, key)
			keys = append(keys, key)
		}
	}
	return keys
}
725430
func (i *InmemBackend) Delete(ctx context.Context, key string) error {
	i.permitPool.Acquire()
	defer i.permitPool.Release()

	i.Lock()
	defer i.Unlock()

	return i.DeleteInternal(ctx, key)
}
1104049
func (ln *LocalNode) Delete(e enr.Entry) {
	ln.mu.Lock()
	defer ln.mu.Unlock()

	ln.delete(e)
}
1243373
func (c *Client) Delete() *Request {
	req := c.Request()
	req.Method("DELETE")
	return req
}
1110064
func (s *CacheOnStorage) Delete(key interface{}) error {
	if err := s.storage.Delete(key); err != nil {
		return err
	}

	return s.cache.Delete(key)
}
1075456
func (r *Router) Delete(pattern string, handlers ...Middleware) *Router {
	return r.Handle(http.MethodDelete, pattern, handlers...)
}
211837
func (s *Wrapper) Delete(ctx context.Context, key []byte) error {
	return s.backend.Delete(ctx, key)
}
353794
func (s *MysqlStore) Delete(key interface{}) error {
	s.lock.Lock()
	defer s.lock.Unlock()

	delete(s.data, key)
	return nil
}
1207780
func (c *FileCacher) Delete(key string) error {
	return os.Remove(c.filepath(key))
}
879085
func (c *MysqlCacher) Delete(key string) error {
	_, err := c.c.Exec("DELETE FROM cache WHERE `key`=?", c.md5(key))
	return err
}
648141
func (db *DB) Delete(key []byte, wo *opt.WriteOptions) error {
	return db.putRec(keyTypeDel, key, nil, wo)
}