// Delete deletes a Linux route. An error is returned if the route does not
// exist or if the route could not be deleted.
174541
func Delete(route Route) error {
	link, err := netlink.LinkByName(route.Device)
	if err != nil {
		return fmt.Errorf("unable to lookup interface %s: %s", route.Device, err)
	}

	// Deletion of routes with Nexthop or Local set fails for IPv6.
	// Therefore do not use getNetlinkRoute().
	routeSpec := netlink.Route{
		Dst:       &route.Prefix,
		LinkIndex: link.Attrs().Index,
	}

	// Scope can only be specified for IPv4
	if route.Prefix.IP.To4() != nil {
		routeSpec.Scope = route.Scope
	}

	if err := netlink.RouteDel(&routeSpec); err != nil {
		return err
	}

	return nil
}
1263018
func (r *Route) Delete(fn http.HandlerFunc) *Route {
	return r.Method(http.MethodDelete, fn)
}
1237667
func (forceApi *ForceApi) Delete(path string, params url.Values) error {
	return forceApi.request("DELETE", path, params, nil, nil)
}
968798
func (r *Route) Delete(handlers ...Handler) *Route {
	return r.group.add("DELETE", r.path, handlers)
}
587745
func (c *Client) Delete(key string) error {
	return c.deleteRecurse(key, false)
}
438777
func (b *BigIP) delete(path ...string) error {
	req := &APIRequest{
		Method: "delete",
		URL:    b.iControlPath(path),
	}

	_, callErr := b.APICall(req)
	return callErr
}
95001
func (a *API) Delete(path string, f func(http.ResponseWriter, *http.Request)) {
	a.router.Del(path, http.HandlerFunc(f))
}
1075456
func (r *Router) Delete(pattern string, handlers ...Middleware) *Router {
	return r.Handle(http.MethodDelete, pattern, handlers...)
}
1266243
func (g *Group) Delete(path string, handler context.Handler) {
	g.Handle(http.MethodDelete, path, handler)
}
958771
func (t *SecondaryTree) Delete(k RouteInfo) (ok bool) {
	pi := -1
	var p *x2
	q := t.r
	if q == nil {
		return false
	}

	for {
		var i int
		i, ok = t.find(q, k)
		if ok {
			switch x := q.(type) {
			case *x2:
				if x.c < kx2 && q != t.r {
					x, i = t.underflowX(p, x, pi, i)
				}
				pi = i + 1
				p = x
				q = x.x[pi].ch
				ok = false
				continue
			case *d2:
				t.extract(x, i)
				if x.c >= kd2 {
					return true
				}

				if q != t.r {
					t.underflow(p, x, pi)
				} else if t.c == 0 {
					t.Clear()
				}
				return true
			}
		}

		switch x := q.(type) {
		case *x2:
			if x.c < kx2 && q != t.r {
				x, i = t.underflowX(p, x, pi, i)
			}
			pi = i
			p = x
			q = x.x[i].ch
		case *d2:
			return false
		}
	}
}
1237396
func (r *Route) Delete(handler http.Handler) *Route {
	r.handlers[http.MethodDelete] = handler
	return r
}
1196792
func (r *Router) Delete(path string, handler HandlerFunc) {
	r.Add(DELETE, path, handler)
}
249128
func (h *Handle) Delete() {
	for _, sh := range h.sockets {
		sh.Close()
	}
	h.sockets = nil
}
966295
func Delete(path string, h interface{}, m ...interface{}) {
	Default.Delete(path, h, m...)
}
882527
func (s *Store) Delete(ctx context.Context, path string) error {
	_, err := s.api.Logical().Delete(path)
	return err
}
516335
func (r *Router) DELETE(path string, handlers ...HandlerFunc) {
	r.Handle("DELETE", path, handlers)
}
1087649
func (c *Client) Delete(endpoint string) (tumblr.Response, error) {
	return c.DeleteWithParams(endpoint, url.Values{})
}