diff options
Diffstat (limited to 'binapi/rdma')
-rw-r--r-- | binapi/rdma/rdma.ba.go | 4 | ||||
-rw-r--r-- | binapi/rdma/rdma_rest.ba.go | 60 | ||||
-rw-r--r-- | binapi/rdma/rdma_rpc.ba.go | 6 |
3 files changed, 5 insertions, 65 deletions
diff --git a/binapi/rdma/rdma.ba.go b/binapi/rdma/rdma.ba.go index f331fc6..cb56007 100644 --- a/binapi/rdma/rdma.ba.go +++ b/binapi/rdma/rdma.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/rdma.api.json // Package rdma contains generated bindings for API file rdma.api. diff --git a/binapi/rdma/rdma_rest.ba.go b/binapi/rdma/rdma_rest.ba.go deleted file mode 100644 index 83346d9..0000000 --- a/binapi/rdma/rdma_rest.ba.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by GoVPP's binapi-generator. DO NOT EDIT. - -package rdma - -import ( - "encoding/json" - "io/ioutil" - "net/http" -) - -func RESTHandler(rpc RPCService) http.Handler { - mux := http.NewServeMux() - mux.HandleFunc("/rdma_create", func(w http.ResponseWriter, req *http.Request) { - var request = new(RdmaCreate) - 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.RdmaCreate(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("/rdma_delete", func(w http.ResponseWriter, req *http.Request) { - var request = new(RdmaDelete) - 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.RdmaDelete(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/rdma/rdma_rpc.ba.go b/binapi/rdma/rdma_rpc.ba.go index 7e9f60d..489297d 100644 --- a/binapi/rdma/rdma_rpc.ba.go +++ b/binapi/rdma/rdma_rpc.ba.go @@ -8,7 +8,7 @@ import ( api "git.fd.io/govpp.git/api" ) -// RPCService defines RPC service rdma. +// RPCService defines RPC service rdma. type RPCService interface { RdmaCreate(ctx context.Context, in *RdmaCreate) (*RdmaCreateReply, error) RdmaDelete(ctx context.Context, in *RdmaDelete) (*RdmaDeleteReply, error) @@ -28,7 +28,7 @@ func (c *serviceClient) RdmaCreate(ctx context.Context, in *RdmaCreate) (*RdmaCr if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) RdmaDelete(ctx context.Context, in *RdmaDelete) (*RdmaDeleteReply, error) { @@ -37,5 +37,5 @@ func (c *serviceClient) RdmaDelete(ctx context.Context, in *RdmaDelete) (*RdmaDe if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } |