diff options
Diffstat (limited to 'binapi/l3xc')
-rw-r--r-- | binapi/l3xc/l3xc.ba.go | 4 | ||||
-rw-r--r-- | binapi/l3xc/l3xc_rest.ba.go | 74 | ||||
-rw-r--r-- | binapi/l3xc/l3xc_rpc.ba.go | 6 |
3 files changed, 5 insertions, 79 deletions
diff --git a/binapi/l3xc/l3xc.ba.go b/binapi/l3xc/l3xc.ba.go index 3dbcfba..ac35157 100644 --- a/binapi/l3xc/l3xc.ba.go +++ b/binapi/l3xc/l3xc.ba.go @@ -1,7 +1,7 @@ // Code generated by GoVPP's binapi-generator. DO NOT EDIT. // versions: -// binapi-generator: v0.4.0-dev -// VPP: 20.05-release +// binapi-generator: v0.4.0 +// VPP: 20.05.1-release // source: /usr/share/vpp/api/plugins/l3xc.api.json // Package l3xc contains generated bindings for API file l3xc.api. 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) -} diff --git a/binapi/l3xc/l3xc_rpc.ba.go b/binapi/l3xc/l3xc_rpc.ba.go index ffd0ff8..d463513 100644 --- a/binapi/l3xc/l3xc_rpc.ba.go +++ b/binapi/l3xc/l3xc_rpc.ba.go @@ -11,7 +11,7 @@ import ( vpe "git.fd.io/govpp.git/binapi/vpe" ) -// RPCService defines RPC service l3xc. +// RPCService defines RPC service l3xc. type RPCService interface { L3xcDel(ctx context.Context, in *L3xcDel) (*L3xcDelReply, error) L3xcDump(ctx context.Context, in *L3xcDump) (RPCService_L3xcDumpClient, error) @@ -33,7 +33,7 @@ func (c *serviceClient) L3xcDel(ctx context.Context, in *L3xcDel) (*L3xcDelReply if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) L3xcDump(ctx context.Context, in *L3xcDump) (RPCService_L3xcDumpClient, error) { @@ -90,5 +90,5 @@ func (c *serviceClient) L3xcUpdate(ctx context.Context, in *L3xcUpdate) (*L3xcUp if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } |