// Erase erases an alert.
// Deprecated: Kept temporarily for backward compatibility.
497913
func (kva *KvAlert) Erase(resourceType api.ResourceType, alertID int64) error {
	kv := kva.GetKvdbInstance()
	if resourceType == api.ResourceType_RESOURCE_TYPE_NONE {
		return ErrResourceNotFound
	}
	_, err := kv.Delete(getResourceKey(resourceType) + strconv.FormatInt(alertID, 10))
	return err
}
921860
func (c *Confirm) Cleanup(val interface{}) error {
	// if the value was previously true
	ans := yesNo(val.(bool))
	// render the template
	return c.Render(
		ConfirmQuestionTemplate,
		ConfirmTemplateData{Confirm: *c, Answer: ans},
	)
}
964280
func (alert *Alert) Serialize(w io.Writer, pver uint32) error {
	err := writeElements(w, alert.Version, alert.RelayUntil,
		alert.Expiration, alert.ID, alert.Cancel)
	if err != nil {
		return err
	}

	count := len(alert.SetCancel)
	if count > maxCountSetCancel {
		str := fmt.Sprintf("too many cancel alert IDs for alert "+
			"[count %v, max %v]", count, maxCountSetCancel)
		return messageError("Alert.Serialize", str)
	}
	err = WriteVarInt(w, pver, uint64(count))
	if err != nil {
		return err
	}
	for i := 0; i < count; i++ {
		err = writeElement(w, alert.SetCancel[i])
		if err != nil {
			return err
		}
	}

	err = writeElements(w, alert.MinVer, alert.MaxVer)
	if err != nil {
		return err
	}

	count = len(alert.SetSubVer)
	if count > maxCountSetSubVer {
		str := fmt.Sprintf("too many sub versions for alert "+
			"[count %v, max %v]", count, maxCountSetSubVer)
		return messageError("Alert.Serialize", str)
	}
	err = WriteVarInt(w, pver, uint64(count))
	if err != nil {
		return err
	}
	for i := 0; i < count; i++ {
		err = WriteVarString(w, pver, alert.SetSubVer[i])
		if err != nil {
			return err
		}
	}

	err = writeElement(w, alert.Priority)
	if err != nil {
		return err
	}
	err = WriteVarString(w, pver, alert.Comment)
	if err != nil {
		return err
	}
	err = WriteVarString(w, pver, alert.StatusBar)
	if err != nil {
		return err
	}
	return WriteVarString(w, pver, alert.Reserved)
}
122324
func (l *Logger) Alert(v interface{}) {
	if l.checkLogLevel(AlertLevel) {
		l.Output(time.Now(), AlertLevel, formatError(v))
	}
}
138690
func (l *Logger) Alert(msg string) error {
	return l.logMsg(nil, LEVEL_ALERT, msg)
}
712814
func (h *ExternalTokenHelper) Erase() error {
	cmd, err := h.cmd("erase")
	if err != nil {
		return err
	}
	if output, err := cmd.CombinedOutput(); err != nil {
		return errwrap.Wrapf(fmt.Sprintf("%q: {{err}}", string(output)), err)
	}
	return nil
}
910540
func (a *AlertsService) Delete(id uint) (*http.Response, error) {
	u := fmt.Sprintf("alerts/%d", id)
	req, err := a.client.NewRequest("DELETE", u, nil)
	if err != nil {
		return nil, err
	}

	return a.client.Do(req, nil)
}
467597
func (c *Cache) Remove(u interface{}) (err error) {

	return c.removeNotify(u, false)
}
684402
func Erase(helper Helper, reader io.Reader) error {
	scanner := bufio.NewScanner(reader)

	buffer := new(bytes.Buffer)
	for scanner.Scan() {
		buffer.Write(scanner.Bytes())
	}

	if err := scanner.Err(); err != nil && err != io.EOF {
		return err
	}

	serverURL := strings.TrimSpace(buffer.String())
	if len(serverURL) == 0 {
		return NewErrCredentialsMissingServerURL()
	}

	return helper.Delete(serverURL)
}
1005393
func (e *Err) Delete(key string) {
	if e.data != nil {
		delete(e.data, key)
	}
}
1222688
func (m *MockCluster) EraseAlert(arg0 api.ResourceType, arg1 int64) error {
	ret := m.ctrl.Call(m, "EraseAlert", arg0, arg1)
	ret0, _ := ret[0].(error)
	return ret0
}
283641
func (a *Writer) Erase(n int) (int, error) {
	return a.WriteString(Erase(n))
}
360229
func (l *Logger) Alert(format string, a ...interface{}) {
	l.Log(LevelAlert, format, a...)
}
909892
func (tlf *TLF) Forget() {
	dir := tlf.getStoredDir()
	if dir != nil {
		dir.Forget()
	}
}
792859
func (c *namespace) erase() error {
	if err := c.presenceCache.DeleteAllNamespaces(); err != nil {
		if !trace.IsNotFound(err) {
			return trace.Wrap(err)
		}
	}
	return nil
}
1115154
func (l *List) remove(e *Element) *Element {
	if e.prev != nil {
		e.prev.next = e.next
	}
	if e.next != nil {
		e.next.prev = e.prev
	}
	e.next = nil // avoid memory leaks
	e.prev = nil // avoid memory leaks
	if e.list == l {
		l.len--
	}

	e.list = nil
	return e
}
471085
func (s *sentinel) Forget(os ...Observable) {
	change := &observableChange{
		observables: os,
		doneC:       make(chan struct{}),
	}
	s.removeC <- change
	<-change.doneC
}