aboutsummaryrefslogtreecommitdiffstats
path: root/binapi/l3xc/l3xc_rest.ba.go
diff options
context:
space:
mode:
Diffstat (limited to 'binapi/l3xc/l3xc_rest.ba.go')
-rw-r--r--binapi/l3xc/l3xc_rest.ba.go74
1 files changed, 0 insertions, 74 deletions
diff --git a/binapi/l3xc/l3xc_rest.ba.go b/binapi/l3xc/l3xc_rest.ba.go
deleted file mode 100644
index 2b2c9ba..0000000
--- a/binapi/l3xc/l3xc_rest.ba.go
+++ /dev/null
@@ -1,74 +0,0 @@
-// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
-
-package l3xc
-
-import (
- "encoding/json"
- "io/ioutil"
- "net/http"
-)
-
-func RESTHandler(rpc RPCService) http.Handler {
- mux := http.NewServeMux()
- mux.HandleFunc("/l3xc_del", func(w http.ResponseWriter, req *http.Request) {
- var request = new(L3xcDel)
- 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.L3xcDel(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)
- })
- mux.HandleFunc("/l3xc_plugin_get_version", func(w http.ResponseWriter, req *http.Request) {
- var request = new(L3xcPluginGetVersion)
- reply, err := rpc.L3xcPluginGetVersion(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)
- })
- mux.HandleFunc("/l3xc_update", func(w http.ResponseWriter, req *http.Request) {
- var request = new(L3xcUpdate)
- 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.L3xcUpdate(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)
-}