X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=binapi%2Fspan%2Fspan_rest.ba.go;fp=binapi%2Fspan%2Fspan_rest.ba.go;h=0000000000000000000000000000000000000000;hb=c2456559a66107441addb96f673191bde09d6977;hp=0c2d9591b81fc448a88239fd87d59041415ce985;hpb=f751f3f845ef56bbcdb873d81a1c6edbc5a87853;p=govpp.git diff --git a/binapi/span/span_rest.ba.go b/binapi/span/span_rest.ba.go deleted file mode 100644 index 0c2d959..0000000 --- a/binapi/span/span_rest.ba.go +++ /dev/null @@ -1,37 +0,0 @@ -// Code generated by GoVPP's binapi-generator. DO NOT EDIT. - -package span - -import ( - "encoding/json" - "io/ioutil" - "net/http" -) - -func RESTHandler(rpc RPCService) http.Handler { - mux := http.NewServeMux() - mux.HandleFunc("/sw_interface_span_enable_disable", func(w http.ResponseWriter, req *http.Request) { - var request = new(SwInterfaceSpanEnableDisable) - b, err := ioutil.ReadAll(req.Body) - if err != nil { - http.Error(w, "read body failed", http.StatusBadRequest) - return - } - if err := json.Unmarshal(b, request); err != nil { - http.Error(w, "unmarshal data failed", http.StatusBadRequest) - return - } - reply, err := rpc.SwInterfaceSpanEnableDisable(req.Context(), request) - if err != nil { - http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) - return - } - rep, err := json.MarshalIndent(reply, "", " ") - if err != nil { - http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) - return - } - w.Write(rep) - }) - return http.HandlerFunc(mux.ServeHTTP) -}