// DeleteAll deletes all in memory messages
175995
func (maildir *Maildir) DeleteAll() error {
	err := os.RemoveAll(maildir.Path)
	if err != nil {
		return err
	}
	return os.Mkdir(maildir.Path, 0770)
}
798627
func (mp *MockPeerCCSupport) RemoveAll() error {
	mp.ccStream = make(map[string]*MockCCComm)
	return nil
}
932250
func (c *Client) removeAlloc(allocID string) {
	c.allocLock.Lock()
	defer c.allocLock.Unlock()

	ar, ok := c.allocs[allocID]
	if !ok {
		if _, ok := c.invalidAllocs[allocID]; ok {
			// Removing from invalid allocs map if present
			delete(c.invalidAllocs, allocID)
		} else {
			// Alloc is unknown, log a warning.
			c.logger.Warn("cannot remove nonexistent alloc", "alloc_id", allocID, "error", "alloc not found")
		}
		return
	}

	// Stop tracking alloc runner as it's been GC'd by the server
	delete(c.allocs, allocID)

	// Ensure the GC has a reference and then collect. Collecting through the GC
	// applies rate limiting
	c.garbageCollector.MarkForCollection(allocID, ar)

	// GC immediately since the server has GC'd it
	go c.garbageCollector.Collect(allocID)
}
128792
func (engine *Engine) dropAll() error {
	session := engine.NewSession()
	defer session.Close()

	err := session.Begin()
	if err != nil {
		return err
	}
	err = session.dropAll()
	if err != nil {
		session.Rollback()
		return err
	}
	return session.Commit()
}
611053
func (o *InvitationManager) RemoveAll(globalid string) error {
	_, err := o.collection.RemoveAll(bson.M{"organization": globalid})
	return err
}
1101013
func (d *driver) listAll(context context.Context, prefix string) ([]string, error) {
	list := make([]string, 0, 64)
	query := &storage.Query{}
	query.Prefix = prefix
	query.Versions = false
	for {
		objects, err := storageListObjects(d.context(context), d.bucket, query)
		if err != nil {
			return nil, err
		}
		for _, obj := range objects.Results {
			// GCS does not guarantee strong consistency between
			// DELETE and LIST operations. Check that the object is not deleted,
			// and filter out any objects with a non-zero time-deleted
			if obj.Deleted.IsZero() {
				list = append(list, obj.Name)
			}
		}
		query = objects.Next
		if query == nil {
			break
		}
	}
	return list, nil
}
575405
func (l *SimpleLRUCache) DeleteAll() {
	for lru := l.cache.Back(); lru != nil; lru = l.cache.Back() {
		l.cache.Remove(lru)
		delete(l.elements, string(lru.Value.(*cacheEntry).key.Hash()))
		l.size--
	}
}
625234
func (l *Loader) ClearAll() Interface {
	l.cacheLock.Lock()
	l.cache.Clear()
	l.cacheLock.Unlock()
	return l
}
12201
func (i *goIpsetProvider) DestroyAll(prefix string) error {

	sets, err := i.ListIPSets()
	if err != nil {
		return ipset.DestroyAll()
	}

	for _, s := range sets {
		if !strings.HasPrefix(s, prefix) {
			continue
		}
		ips := i.GetIpset(s)
		if err := ips.Destroy(); err != nil {
			return ipset.DestroyAll()
		}
	}

	return nil
}
63785
func (c *containerManager) RemoveAll(stdout io.Writer) {
	for containerID := range c.tmpContainers {
		if err := c.removeContainer(containerID, stdout); err != nil {
			return
		}
		delete(c.tmpContainers, containerID)
		fmt.Fprintf(stdout, "Removing intermediate container %s\n", stringid.TruncateID(containerID))
	}
}
742676
func RemoveAll(fs Filesystem, path string) error {
	if err := fs.Remove(path); err == nil || os.IsNotExist(err) {
		return nil
	}

	// We could not delete it, so might be a directory
	fis, err := fs.ReadDir(path)
	if err != nil {
		if os.IsNotExist(err) {
			return nil
		}
		return err
	}

	// Remove contents & return first error.
	err = nil
	for _, fi := range fis {
		err1 := RemoveAll(fs, path+string(fs.PathSeparator())+fi.Name())
		if err == nil {
			err = err1
		}
	}

	// Remove directory itself.
	err1 := fs.Remove(path)
	if err1 == nil || os.IsNotExist(err1) {
		return nil
	}
	if err == nil {
		err = err1
	}
	return err
}
245913
func (c oauthClient) DeleteAllLists() error {
	lists, err := c.Lists()
	if err != nil {
		return err
	}

	listCount := len(lists)
	c.logger.Debug("delete-all-lists", map[string]interface{}{"listCount": listCount})
	idErrChan := make(chan idErr, listCount)
	for _, l := range lists {
		go func(list wl.List) {
			c.logger.Debug("delete-all-lists - deleting list", map[string]interface{}{"listID": list.ID})
			var err error
			if list.ListType == "inbox" {
				err = nil
			} else {
				err = c.DeleteList(list)
			}
			idErrChan <- idErr{idType: "list", id: list.ID, err: err}
		}(l)
	}

	e := multiIDErr{}
	for i := 0; i < len(lists); i++ {
		idErr := <-idErrChan
		if idErr.err != nil {
			c.logger.Debug("delete-all-lists - error received", map[string]interface{}{"id": idErr.id, "err": err})
			e.addError(idErr)
		}
	}

	if len(e.errors()) > 0 {
		return e
	}

	return nil
}
971931
func (s *Service) DropAll(w io.Writer) error {
	if err := s.DropAllImages(w); err != nil {
		return err
	}
	if err := s.DropAllRaws(w); err != nil {
		return err
	}
	return nil
}
897151
func (c *MemoryGroupService) GroupDelete(ctx context.Context, groupName string) error {
	memoryGroupsMu.Lock()
	defer memoryGroupsMu.Unlock()

	_, ok := memoryGroups[groupName]
	if !ok {
		return constants.ErrGroupNotFound
	}

	delete(memoryGroups, groupName)
	return nil
}
160522
func (s *Session) MessageReactionsRemoveAll(channelID, messageID string) error {

	_, err := s.RequestWithBucketID("DELETE", EndpointMessageReactionsAll(channelID, messageID), nil, EndpointMessageReactionsAll(channelID, messageID))

	return err
}
1250574
func (m *Map) DeleteAll() error {
	m.lock.Lock()
	defer m.lock.Unlock()

	scopedLog := m.scopedLogger()
	scopedLog.Debug("deleting all entries in map")

	key := make([]byte, m.KeySize)
	nextKey := make([]byte, m.KeySize)

	if m.cache != nil {
		// Mark all entries for deletion, upon successful deletion,
		// entries will be removed or the LastError will be updated
		for _, entry := range m.cache {
			entry.DesiredAction = Delete
			entry.LastError = fmt.Errorf("deletion pending")
		}
	}

	if err := m.Open(); err != nil {
		return err
	}

	for {
		err := GetNextKey(
			m.fd,
			unsafe.Pointer(&key[0]),
			unsafe.Pointer(&nextKey[0]),
		)

		if err != nil {
			break
		}

		err = DeleteElement(m.fd, unsafe.Pointer(&nextKey[0]))

		k, _, err2 := m.dumpParser(nextKey, []byte{})
		if err2 == nil {
			m.deleteCacheEntry(k, err)
		} else {
			log.WithError(err2).Warningf("Unable to correlate iteration key %v with cache entry. Inconsistent cache.", nextKey)
		}

		if err != nil {
			return err
		}

		copy(key, nextKey)
	}

	return nil
}
292291
func (c *Cache) DeleteAll() {
	var keys []interface{}
	c.m.Range(func(key interface{}, value interface{}) bool {
		c.close(key.(string), value.(future))
		keys = append(keys, key)
		return true
	})

	for _, key := range keys {
		c.m.Delete(key)
	}
}