// Delete the source from SourcesStore
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)
}
202225
func (s *DirectStore) Sources(ctx context.Context) chronograf.SourcesStore {
	return s.SourcesStore
}
424082
func (c *memoryStore) Delete(id string) {
	c.Lock()
	delete(c.s, id)
	c.Unlock()
}
570439
func (s *SourceService) DeleteSource(ctx context.Context, id influxdb.ID) error {
	m, err := s.s.FindSourceByID(ctx, id)
	if err != nil {
		return err
	}

	if err := authorizeWriteSource(ctx, m.OrganizationID, id); err != nil {
		return err
	}

	return s.s.DeleteSource(ctx, id)
}
209498
func (d *Datastore) Delete(key ds.Key) (err error) {
	return d.child.Delete(d.ConvertKey(key))
}
286960
func (l *LocalStore) Delete(ctx context.Context, obj string) error {
	fo := path.Join(l.storepath, obj)
	os.Remove(fo)
	mf := fo + ".metadata"
	if cloudstorage.Exists(mf) {
		os.Remove(mf)
	}
	return nil
}
1097352
func (store *MemoryStore) Del(key string) error {
	store.Lock()
	defer store.Unlock()

	delete(store.events, key)

	store.eC--

	return nil
}
1012097
func (s *Service) RemoveSourceUser(w http.ResponseWriter, r *http.Request) {
	ctx := r.Context()
	uid := httprouter.GetParamFromContext(ctx, "uid")

	_, store, err := s.sourceUsersStore(ctx, w, r)
	if err != nil {
		return
	}

	if err := store.Delete(ctx, &chronograf.User{Name: uid}); err != nil {
		Error(w, http.StatusBadRequest, err.Error(), s.Logger)
		return
	}

	w.WriteHeader(http.StatusNoContent)
}
743639
func (r *Store) Delete(ctx context.Context, name string) error {
	ctx, store, sn := r.getStore(ctx, name)
	if sn == "" {
		return errors.Errorf("can not delete a mount point. Use `gopass mounts remove %s`", store.Alias())
	}
	return store.Delete(ctx, sn)
}
1015573
func (f *FileStore) Delete(keys [][]byte) error {
	return f.DeleteRange(keys, math.MinInt64, math.MaxInt64)
}
1033414
func (s *CertFileUserStore) Delete(key msp.IdentityIdentifier) error {
	return s.store.Delete(storeKeyFromUserIdentifier(key))
}
1238985
func (m *Source) Close() error {
	if m.db != nil {
		err := m.db.Close()
		if err != nil {
			return err
		}
		m.db = nil
	}
	return nil
}
1082311
func (store *KapacitorStore) Delete(ctx context.Context, kap chronograf.Server) error {
	if store.Kapacitor == nil || store.Kapacitor.ID != kap.ID {
		return fmt.Errorf("unable to find Kapacitor with id %d", kap.ID)
	}
	store.Kapacitor = nil
	return nil
}
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
}
784422
func (command S3ArtifactPublisherResource) Delete(awsSession *session.Session,
	event *CloudFormationLambdaEvent,
	logger *logrus.Logger) (map[string]interface{}, error) {

	unmarshalErr := json.Unmarshal(event.ResourceProperties, &command)
	if unmarshalErr != nil {
		return nil, unmarshalErr
	}
	s3DeleteObjectParams := &s3.DeleteObjectInput{
		Bucket: aws.String(command.Bucket.Literal),
		Key:    aws.String(command.Key.Literal),
	}
	s3Svc := s3.New(awsSession)
	_, s3ResponseErr := s3Svc.DeleteObject(s3DeleteObjectParams)
	if s3ResponseErr != nil {
		return nil, s3ResponseErr
	}
	logger.WithFields(logrus.Fields{
		"Bucket": command.Bucket.Literal,
		"Key":    command.Key.Literal,
	}).Info("Object deleted")
	return nil, nil
}
450081
func (s *RedisAnnouncementStore) Delete(serviceName, serviceID string) error {
	metadata, err := s.GetMetadata(serviceName, serviceID)
	if err != nil && errors.GetErrType(err) != errors.NotFound {
		return err
	}
	if len(metadata) > 0 {
		s.RemoveMetadata(serviceName, serviceID, metadata...)
	}
	key := fmt.Sprintf("%s:%s", serviceName, serviceID)
	err = s.store.Delete(key)
	if err != nil {
		return err
	}
	return nil
}
171242
func (command SESLambdaEventSourceResource) Delete(awsSession *session.Session,
	event *CloudFormationLambdaEvent,
	logger *logrus.Logger) (map[string]interface{}, error) {
	return command.updateSESRules(false, awsSession, event, logger)
}