// Delete implements the ds.Datastore interface.
172303
func (dds *Delayed) Delete(key ds.Key) (err error) {
	dds.delay.Wait()
	return dds.ds.Delete(key)
}
1022462
func (s *FileSystemStorage) Delete(filepath string) error {
	return os.Remove(s.Path(filepath))
}
978978
func (s *Session) Delete(key string) error {
	s.isDirty = true

	delete(s.data, key)
	return nil
}
861290
func (fs *FileSessionStore) Delete(key interface{}) {
	fs.lock.Lock()
	defer fs.lock.Unlock()
	delete(fs.values, key)
}
258252
func (s *RedisDeviceStore) Delete(appEUI types.AppEUI, devEUI types.DevEUI) error {
	key := s.key(appEUI, devEUI)

	deviceI, err := s.store.GetFields(key, "dev_addr")
	if err != nil {
		return err
	}

	device, ok := deviceI.(Device)
	if !ok {
		errors.New("Database did not return a Device")
	}

	if !device.DevAddr.IsEmpty() {
		if err := s.devAddrIndex.Remove(device.DevAddr.String(), key); err != nil {
			return err
		}
	}

	return s.store.Delete(key)
}
1248508
func (self *Model) Delete(ids ...interface{}) error {
	return self.db.Delete(self.collection.Name, ids...)
}
1055372
func (r *MemoryNoTS) Delete(key string) error {
	delete(r.items, key)
	return nil
}
134260
func (n *NodeStore) Delete(key []byte) error {
	return n.store.Delete(n.addr, key)
}
570380
func (db *BytesConnectionRedis) Delete(key string, opts ...datasync.DelOption) (found bool, err error) {
	if db.closed {
		return false, fmt.Errorf("Delete(%s) called on a closed connection", key)
	}
	db.Debugf("Delete(%s)", key)

	keysToDelete := []string{}

	var keyIsPrefix bool
	for _, o := range opts {
		if _, ok := o.(*datasync.WithPrefixOpt); ok {
			keyIsPrefix = true
		}
	}
	if keyIsPrefix {
		iterator, err := db.ListKeys(key)
		if err != nil {
			return false, err
		}
		for {
			k, _, last := iterator.GetNext()
			if last {
				break
			}
			keysToDelete = append(keysToDelete, k)
		}
		if len(keysToDelete) == 0 {
			return false, nil
		}
		db.Debugf("Delete(%s): deleting %v", key, keysToDelete)
	} else {
		keysToDelete = append(keysToDelete, key)
	}

	intCmd := db.client.Del(keysToDelete...)
	if intCmd.Err() != nil {
		return false, fmt.Errorf("Delete(%s) failed: %s", key, intCmd.Err())
	}
	return (intCmd.Val() != 0), nil
}
1169231
func (s *SessionStatsCollector) Delete() {
	s.Lock()
	defer s.Unlock()
	s.deleted = true
}
1321942
func (multi *KapacitorStore) Delete(ctx context.Context, kap chronograf.Server) error {
	var err error
	for _, store := range multi.Stores {
		err = store.Delete(ctx, kap)
		if err == nil {
			return nil
		}
	}
	return err
}
635475
func (*Instances) Delete(c context.Context, req *instances.DeleteRequest) (*empty.Empty, error) {
	if req.GetId() == "" {
		return nil, status.Errorf(codes.InvalidArgument, "ID is required")
	}
	vm := &model.VM{
		ID: req.Id,
	}
	if err := datastore.RunInTransaction(c, func(c context.Context) error {
		switch err := datastore.Get(c, vm); {
		case err == datastore.ErrNoSuchEntity:
			return nil
		case err != nil:
			return errors.Annotate(err, "failed to fetch VM").Err()
		case vm.Drained:
			return nil
		}
		vm.Drained = true
		if err := datastore.Put(c, vm); err != nil {
			return errors.Annotate(err, "failed to store VM").Err()
		}
		return nil
	}, nil); err != nil {
		return nil, err
	}
	return &empty.Empty{}, nil
}
76522
func (s *storeImpl) Delete(ctx datastore.Context, id string) error {
	defer ctx.Metrics().Stop(ctx.Metrics().Start("ImageRegistryStore.Delete"))
	return s.ds.Delete(ctx, Key(id))
}
1365237
func (s *Store) Delete(ctx context.Context, name string) error {
	return s.delete(ctx, name, false)
}
762217
func (s *SourcesStore) Delete(ctx context.Context, d chronograf.Source) error {
	err := validOrganization(ctx)
	if err != nil {
		return err
	}

	d, err = s.store.Get(ctx, d.ID)
	if err != nil {
		return err
	}

	return s.store.Delete(ctx, d)
}
987582
func (virtualDisk *VirtualDisk) Delete(ctx context.Context, datacenter *vclib.Datacenter) error {
	return getDiskManager(virtualDisk, VirtualDiskDeleteOperation).Delete(ctx, datacenter)
}
194562
func (c *Cache) Delete(_ context.Context, key dataloader.Key) bool {
	if _, found := c.c.Get(key.String()); found {
		c.c.Delete(key.String())
		return true
	}
	return false
}