diff options
Diffstat (limited to 'binapi/svs')
-rw-r--r-- | binapi/svs/svs.ba.go | 4 | ||||
-rw-r--r-- | binapi/svs/svs_rest.ba.go | 97 | ||||
-rw-r--r-- | binapi/svs/svs_rpc.ba.go | 8 |
3 files changed, 6 insertions, 103 deletions
diff --git a/binapi/svs/svs.ba.go b/binapi/svs/svs.ba.go index 911e936..1f65a76 100644 --- a/binapi/svs/svs.ba.go +++ b/binapi/svs/svs.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/svs.api.json // Package svs contains generated bindings for API file svs.api. diff --git a/binapi/svs/svs_rest.ba.go b/binapi/svs/svs_rest.ba.go deleted file mode 100644 index 4293223..0000000 --- a/binapi/svs/svs_rest.ba.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by GoVPP's binapi-generator. DO NOT EDIT. - -package svs - -import ( - "encoding/json" - "io/ioutil" - "net/http" -) - -func RESTHandler(rpc RPCService) http.Handler { - mux := http.NewServeMux() - mux.HandleFunc("/svs_enable_disable", func(w http.ResponseWriter, req *http.Request) { - var request = new(SvsEnableDisable) - 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.SvsEnableDisable(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("/svs_plugin_get_version", func(w http.ResponseWriter, req *http.Request) { - var request = new(SvsPluginGetVersion) - reply, err := rpc.SvsPluginGetVersion(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("/svs_route_add_del", func(w http.ResponseWriter, req *http.Request) { - var request = new(SvsRouteAddDel) - 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.SvsRouteAddDel(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("/svs_table_add_del", func(w http.ResponseWriter, req *http.Request) { - var request = new(SvsTableAddDel) - 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.SvsTableAddDel(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/svs/svs_rpc.ba.go b/binapi/svs/svs_rpc.ba.go index 3de2a03..4d344a1 100644 --- a/binapi/svs/svs_rpc.ba.go +++ b/binapi/svs/svs_rpc.ba.go @@ -11,7 +11,7 @@ import ( vpe "git.fd.io/govpp.git/binapi/vpe" ) -// RPCService defines RPC service svs. +// RPCService defines RPC service svs. type RPCService interface { SvsDump(ctx context.Context, in *SvsDump) (RPCService_SvsDumpClient, error) SvsEnableDisable(ctx context.Context, in *SvsEnableDisable) (*SvsEnableDisableReply, error) @@ -73,7 +73,7 @@ func (c *serviceClient) SvsEnableDisable(ctx context.Context, in *SvsEnableDisab if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) SvsPluginGetVersion(ctx context.Context, in *SvsPluginGetVersion) (*SvsPluginGetVersionReply, error) { @@ -91,7 +91,7 @@ func (c *serviceClient) SvsRouteAddDel(ctx context.Context, in *SvsRouteAddDel) if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) SvsTableAddDel(ctx context.Context, in *SvsTableAddDel) (*SvsTableAddDelReply, error) { @@ -100,5 +100,5 @@ func (c *serviceClient) SvsTableAddDel(ctx context.Context, in *SvsTableAddDel) if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } |