github.com/cilium/cilium@v1.16.2/api/v1/server/restapi/endpoint/delete_endpoint_id.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  // Copyright Authors of Cilium
     4  // SPDX-License-Identifier: Apache-2.0
     5  
     6  package endpoint
     7  
     8  // This file was generated by the swagger tool.
     9  // Editing this file might prove futile when you re-run the generate command
    10  
    11  import (
    12  	"net/http"
    13  
    14  	"github.com/go-openapi/runtime/middleware"
    15  )
    16  
    17  // DeleteEndpointIDHandlerFunc turns a function with the right signature into a delete endpoint ID handler
    18  type DeleteEndpointIDHandlerFunc func(DeleteEndpointIDParams) middleware.Responder
    19  
    20  // Handle executing the request and returning a response
    21  func (fn DeleteEndpointIDHandlerFunc) Handle(params DeleteEndpointIDParams) middleware.Responder {
    22  	return fn(params)
    23  }
    24  
    25  // DeleteEndpointIDHandler interface for that can handle valid delete endpoint ID params
    26  type DeleteEndpointIDHandler interface {
    27  	Handle(DeleteEndpointIDParams) middleware.Responder
    28  }
    29  
    30  // NewDeleteEndpointID creates a new http.Handler for the delete endpoint ID operation
    31  func NewDeleteEndpointID(ctx *middleware.Context, handler DeleteEndpointIDHandler) *DeleteEndpointID {
    32  	return &DeleteEndpointID{Context: ctx, Handler: handler}
    33  }
    34  
    35  /*
    36  	DeleteEndpointID swagger:route DELETE /endpoint/{id} endpoint deleteEndpointId
    37  
    38  # Delete endpoint
    39  
    40  Deletes the endpoint specified by the ID. Deletion is imminent and
    41  atomic, if the deletion request is valid and the endpoint exists,
    42  deletion will occur even if errors are encountered in the process. If
    43  errors have been encountered, the code 202 will be returned, otherwise
    44  200 on success.
    45  
    46  All resources associated with the endpoint will be freed and the
    47  workload represented by the endpoint will be disconnected.It will no
    48  longer be able to initiate or receive communications of any sort.
    49  */
    50  type DeleteEndpointID struct {
    51  	Context *middleware.Context
    52  	Handler DeleteEndpointIDHandler
    53  }
    54  
    55  func (o *DeleteEndpointID) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
    56  	route, rCtx, _ := o.Context.RouteInfo(r)
    57  	if rCtx != nil {
    58  		*r = *rCtx
    59  	}
    60  	var Params = NewDeleteEndpointIDParams()
    61  	if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
    62  		o.Context.Respond(rw, r, route.Produces, route, err)
    63  		return
    64  	}
    65  
    66  	res := o.Handler.Handle(Params) // actually handle the request
    67  	o.Context.Respond(rw, r, route.Produces, route, res)
    68  
    69  }