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

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