// DeleteInterest removes the specified interest (by its ID or its Value).
350272
func (user *User) DeleteInterest(interest *Interest) error {
	var toDelete Interest
	if interest.ID <= 0 {
		if interest.Value == "" {
			return errors.New("Invalid interest ID and empty interest")
		}
		toDelete.Value = interest.Value
	} else {
		toDelete.ID = interest.ID
	}

	if interest.From != user.ID() {
		return errors.New("You can't remove other user interests")
	}

	toDelete.From = interest.From

	return Db().Where(&toDelete).Delete(Interest{})
}
807577
func (s *Store) deleteVariant(ident Ident) (err error) {
	identPath, err := s.identPath(ident)
	if err != nil {
		return err
	}
	err = s.conn.Delete(identPath, ident.actualVersion())
	switch err {
	case zk.ErrNoNode:
		// perhaps someone already deleted it?
		return nil
	case zk.ErrBadVersion:
		return ErrVersionConflict
	}
	return err
}
541379
func (c *threadSafeMap) deleteFromIndices(obj interface{}, key string) {
	for name, indexFunc := range c.indexers {
		indexValues, err := indexFunc(obj)
		if err != nil {
			panic(fmt.Errorf("unable to calculate an index entry for key %q on index %q: %v", key, name, err))
		}

		index := c.indices[name]
		if index == nil {
			continue
		}
		for _, indexValue := range indexValues {
			set := index[indexValue]
			if set != nil {
				set.Delete(key)
			}
		}
	}
}
1128065
func (mc MongoClient) DeleteRegistrationById(id string) error {
	return mc.deleteById(db.ExportCollection, id)
}
1026289
func (user *User) Interests() (interests []string) {
	Db().Model(Interest{}).Where(Interest{From: user.ID()}).Pluck(`"value"`, &interests)
	return
}
48185
func (client *VaultClient) DeleteSender(req *http.Request) (*http.Response, error) {
	return autorest.SendWithSender(client,
		req,
		azure.DoPollForAsynchronous(client.PollingDelay))
}
1168294
func (jl *Solver) deleteIfUnreferenced(k digest.Digest, st *state) {
	if len(st.jobs) == 0 && len(st.parents) == 0 {
		for chKey := range st.childVtx {
			chState := jl.actives[chKey]
			delete(chState.parents, k)
			jl.deleteIfUnreferenced(chKey, chState)
		}
		st.Release()
		delete(jl.actives, k)
	}
}
135009
func (api *Client) DeleteApplication(id string) error {
	_, _, err := api.makeRequest(http.MethodDelete, fmt.Sprintf("%s/%s", api.concatUserPath(applicationsPath), id))
	return err
}
307930
func (s *Reporter) DeleteRange(ctx context.Context, startKey []byte, endKey []byte) error {
	start := s.Clock().Now()
	err := s.Backend.DeleteRange(ctx, startKey, endKey)
	batchWriteLatencies.WithLabelValues(s.Component).Observe(time.Since(start).Seconds())
	batchWriteRequests.WithLabelValues(s.Component).Inc()
	if err != nil && !trace.IsNotFound(err) {
		batchWriteRequestsFailed.WithLabelValues(s.Component).Inc()
	}
	s.trackRequest(OpDelete, startKey, endKey)
	return err
}
184862
func (cm *CIDRMap) DeleteCIDR(cidr net.IPNet) error {
	key := cm.cidrKeyInit(cidr)
	if err := cm.checkPrefixlen(&key, "delete"); err != nil {
		return err
	}
	log.WithField(logfields.Path, cm.path).Debugf("Removing CIDR entry %s", cidr.String())
	return bpf.DeleteElement(cm.Fd, unsafe.Pointer(&key))
}
387508
func (c *Client) DeleteRegistrationById(id string) error {
	conn := c.Pool.Get()
	defer conn.Close()

	return deleteRegistration(conn, id)
}
857437
func (r FilteringResourceEventHandler) OnDelete(obj interface{}) {
	if !r.FilterFunc(obj) {
		return
	}
	r.Handler.OnDelete(obj)
}
209024
func (kz *Kazoo) DeleteTopic(name string) error {
	node := fmt.Sprintf("%s/admin/delete_topics/%s", kz.conf.Chroot, name)

	exists, err := kz.exists(node)
	if err != nil {
		return err
	}
	if exists {
		return ErrTopicMarkedForDelete
	}

	if err := kz.create(node, nil, false); err != nil {
		return err
	}
	return nil
}
753999
func (c oauthClient) DeleteReminder(reminder wl.Reminder) error {
	url := fmt.Sprintf(
		"%s/reminders/%d?revision=%d",
		c.apiURL,
		reminder.ID,
		reminder.Revision,
	)

	req, err := c.newDeleteRequest(url)
	if err != nil {
		return err
	}

	resp, err := c.do(req)
	if err != nil {
		return err
	}

	if resp.StatusCode != http.StatusNoContent {
		return fmt.Errorf("Unexpected response code %d - expected %d", resp.StatusCode, http.StatusNoContent)
	}

	return nil
}
105350
func (n *NSQD) DeleteExistingTopic(topicName string) error {
	n.RLock()
	topic, ok := n.topicMap[topicName]
	if !ok {
		n.RUnlock()
		return errors.New("topic does not exist")
	}
	n.RUnlock()

	// delete empties all channels and the topic itself before closing
	// (so that we dont leave any messages around)
	//
	// we do this before removing the topic from map below (with no lock)
	// so that any incoming writes will error and not create a new topic
	// to enforce ordering
	topic.Delete()

	n.Lock()
	delete(n.topicMap, topicName)
	n.Unlock()

	return nil
}
878916
func (c *ConsulAlertClient) DeleteReminder(node string, checkid string) {
	key := fmt.Sprintf("consul-alerts/reminders/%s/%s", node, checkid)
	c.api.KV().Delete(key, nil)
	log.Println("Deleting reminder for node: ", node)
}
143417
func (s *ChangesService) DeleteReviewed(changeID, revisionID, fileID string) (*Response, error) {
	u := fmt.Sprintf("changes/%s/revisions/%s/files/%s/reviewed", changeID, revisionID, url.PathEscape(fileID))
	return s.client.DeleteRequest(u, nil)
}