// Unregister removes a path from the mux.
555722
func (m *PathRecorderMux) Unregister(path string) {
	m.lock.Lock()
	defer m.lock.Unlock()

	delete(m.pathToHandler, path)
	delete(m.prefixToHandler, path)
	delete(m.pathStacks, path)
	for i := range m.exposedPaths {
		if m.exposedPaths[i] == path {
			m.exposedPaths = append(m.exposedPaths[:i], m.exposedPaths[i+1:]...)
			break
		}
	}

	m.refreshMuxLocked()
}
1130225
func (reg *Registry) Remove(printerName string) *Registry {
	reg.mu.Lock()
	for i, p := range reg.printers {
		if p.Name == printerName {
			reg.printers = append(reg.printers[:i], reg.printers[i+1:]...)
			break
		}
	}
	reg.mu.Unlock()
	return reg
}
750963
func unregisterCallback(cbArg *callbackArg) {
	callbacksLock.Lock()
	defer callbacksLock.Unlock()
	if _, ok := callbacks[cbArg.id]; !ok {
		panic(fmt.Sprintf("Callback ID %d not registered", cbArg.id))
	}
	delete(callbacks, cbArg.id)
}
998008
func (r *PrefixedRegistry) GetOrRegister(name string, metric interface{}) interface{} {
	realName := r.prefix + name
	return r.underlying.GetOrRegister(realName, metric)
}
690870
func (ovs *OvsdbClient) Unregister(handler NotificationHandler) error {
	ovs.handlersMutex.Lock()
	defer ovs.handlersMutex.Unlock()
	i, err := getHandlerIndex(handler, ovs.handlers)
	if err != nil {
		return err
	}
	ovs.handlers = append(ovs.handlers[:i], ovs.handlers[i+1:]...)
	return nil
}
19918
func (d *Downloader) UnregisterPeer(id string) error {
	// Unregister the peer from the active peer set and revoke any fetch tasks
	logger := log.New("peer", id)
	logger.Trace("Unregistering sync peer")
	if err := d.peers.Unregister(id); err != nil {
		logger.Error("Failed to unregister sync peer", "err", err)
		return err
	}
	d.queue.Revoke(id)

	// If this peer was the master peer, abort sync immediately
	d.cancelLock.RLock()
	master := id == d.cancelPeer
	d.cancelLock.RUnlock()

	if master {
		d.cancel()
	}
	return nil
}
313869
func (c *Cluster) Unregister(address string) error {
	err := c.runHookForAddr(HookEventBeforeNodeUnregister, address)
	if err != nil {
		return err
	}
	return c.storage().RemoveNode(address)
}
632515
func (d *requestDistributor) unregisterPeer(p *peer) {
	d.peerLock.Lock()
	delete(d.peers, p)
	d.peerLock.Unlock()
}
479187
func (api UsersAPI) DeleteUserRegistryEntry(w http.ResponseWriter, r *http.Request) {
	username := mux.Vars(r)["username"]
	key := mux.Vars(r)["key"]

	mgr := registry.NewManager(r)
	err := mgr.DeleteRegistryEntry(username, "", key)

	if err != nil {
		log.Error(err.Error())
		http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
		return
	}

	w.WriteHeader(http.StatusNoContent)
}
1136391
func (nu *Numbered) Unregister(id int64, reason string) {
	success := nu.unregister(id, reason)
	if success {
		nu.recentlyUnregistered.Set(
			fmt.Sprintf("%v", id), &unregistered{reason: reason, timeUnregistered: time.Now()})
	}
}
136442
func (client *RegistryIndexClient) RemoveImage(image string) error {
	var err error
	if image, err = client.parseImage(image); err != nil {
		return err
	}
	return client.facade.DeleteRegistryImage(client.ctx, image)
}
208803
func ReRegister(params ReRegisterParams) (*Identity, error) {
	hostID, err := params.ID.HostID()
	if err != nil {
		return nil, trace.Wrap(err)
	}
	keys, err := params.Client.GenerateServerKeys(GenerateServerKeysRequest{
		HostID:               hostID,
		NodeName:             params.ID.NodeName,
		Roles:                teleport.Roles{params.ID.Role},
		AdditionalPrincipals: params.AdditionalPrincipals,
		DNSNames:             params.DNSNames,
		PublicTLSKey:         params.PublicTLSKey,
		PublicSSHKey:         params.PublicSSHKey,
		Rotation:             &params.Rotation,
	})
	if err != nil {
		return nil, trace.Wrap(err)
	}
	keys.Key = params.PrivateKey

	return ReadIdentityFromKeyPair(keys)
}
637785
func (i *Index) Remove(path string) (*Entry, error) {
	path = filepath.ToSlash(path)
	for index, e := range i.Entries {
		if e.Name == path {
			i.Entries = append(i.Entries[:index], i.Entries[index+1:]...)
			return e, nil
		}
	}

	return nil, ErrEntryNotFound
}
631921
func UnRegisterListener(listenerObj core.EventListener, key ...string) error {
	return factory.UnRegisterListener(listenerObj, key...)
}
207808
func (reg *WatchDataReg) Unregister(keyPrefix string) error {
	reg.adapter.access.Lock()
	defer reg.adapter.access.Unlock()

	subs := reg.adapter.subscriptions[reg.ResyncName]
	// verify if key is registered for change events
	if subs.ChangeChan == nil {
		// not an error
		logrus.DefaultLogger().Infof("key %v not registered for change events", keyPrefix)
		return nil
	}
	if subs.CloseChan == nil {
		return fmt.Errorf("unable to unregister key %v, close channel in subscription is nil", keyPrefix)
	}

	for index, prefix := range subs.KeyPrefixes {
		if prefix == keyPrefix {
			subs.KeyPrefixes = append(subs.KeyPrefixes[:index], subs.KeyPrefixes[index+1:]...)
			subs.CloseChan <- keyPrefix
			logrus.DefaultLogger().WithField("resyncName", reg.ResyncName).Infof("Key %v removed from subscription", keyPrefix)
			return nil
		}
	}

	return fmt.Errorf("key %v to unregister was not found", keyPrefix)
}
1040645
func remove(path string) {
	err := os.Remove(path)
	if err != nil {
		fmt.Fprintf(os.Stderr, "could not remove %v: %v\n", path, err)
	}
}
95658
func (r *RegistrationDB) RemoveRegistration(k Registration) {
	r.Lock()
	defer r.Unlock()
	delete(r.registrationMap, k)
}