aboutsummaryrefslogtreecommitdiffstats
path: root/binapi/memclnt
diff options
context:
space:
mode:
Diffstat (limited to 'binapi/memclnt')
-rw-r--r--binapi/memclnt/memclnt.ba.go4
-rw-r--r--binapi/memclnt/memclnt_rest.ba.go203
-rw-r--r--binapi/memclnt/memclnt_rpc.ba.go12
3 files changed, 8 insertions, 211 deletions
diff --git a/binapi/memclnt/memclnt.ba.go b/binapi/memclnt/memclnt.ba.go
index 3bbf88d..0dac33f 100644
--- a/binapi/memclnt/memclnt.ba.go
+++ b/binapi/memclnt/memclnt.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/core/memclnt.api.json
// Package memclnt contains generated bindings for API file memclnt.api.
diff --git a/binapi/memclnt/memclnt_rest.ba.go b/binapi/memclnt/memclnt_rest.ba.go
deleted file mode 100644
index bb409da..0000000
--- a/binapi/memclnt/memclnt_rest.ba.go
+++ /dev/null
@@ -1,203 +0,0 @@
-// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
-
-package memclnt
-
-import (
- "encoding/json"
- "io/ioutil"
- "net/http"
-)
-
-func RESTHandler(rpc RPCService) http.Handler {
- mux := http.NewServeMux()
- mux.HandleFunc("/api_versions", func(w http.ResponseWriter, req *http.Request) {
- var request = new(APIVersions)
- reply, err := rpc.APIVersions(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("/get_first_msg_id", func(w http.ResponseWriter, req *http.Request) {
- var request = new(GetFirstMsgID)
- 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.GetFirstMsgID(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("/memclnt_create", func(w http.ResponseWriter, req *http.Request) {
- var request = new(MemclntCreate)
- 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.MemclntCreate(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("/memclnt_delete", func(w http.ResponseWriter, req *http.Request) {
- var request = new(MemclntDelete)
- 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.MemclntDelete(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("/memclnt_keepalive", func(w http.ResponseWriter, req *http.Request) {
- var request = new(MemclntKeepalive)
- reply, err := rpc.MemclntKeepalive(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("/rpc_call", func(w http.ResponseWriter, req *http.Request) {
- var request = new(RPCCall)
- 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.RPCCall(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("/sock_init_shm", func(w http.ResponseWriter, req *http.Request) {
- var request = new(SockInitShm)
- 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.SockInitShm(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("/sockclnt_create", func(w http.ResponseWriter, req *http.Request) {
- var request = new(SockclntCreate)
- 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.SockclntCreate(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("/sockclnt_delete", func(w http.ResponseWriter, req *http.Request) {
- var request = new(SockclntDelete)
- 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.SockclntDelete(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/memclnt/memclnt_rpc.ba.go b/binapi/memclnt/memclnt_rpc.ba.go
index ae75a36..ef4a1a4 100644
--- a/binapi/memclnt/memclnt_rpc.ba.go
+++ b/binapi/memclnt/memclnt_rpc.ba.go
@@ -8,7 +8,7 @@ import (
api "git.fd.io/govpp.git/api"
)
-// RPCService defines RPC service memclnt.
+// RPCService defines RPC service memclnt.
type RPCService interface {
APIVersions(ctx context.Context, in *APIVersions) (*APIVersionsReply, error)
GetFirstMsgID(ctx context.Context, in *GetFirstMsgID) (*GetFirstMsgIDReply, error)
@@ -39,7 +39,7 @@ func (c *serviceClient) APIVersions(ctx context.Context, in *APIVersions) (*APIV
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) GetFirstMsgID(ctx context.Context, in *GetFirstMsgID) (*GetFirstMsgIDReply, error) {
@@ -48,7 +48,7 @@ func (c *serviceClient) GetFirstMsgID(ctx context.Context, in *GetFirstMsgID) (*
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) MemclntCreate(ctx context.Context, in *MemclntCreate) (*MemclntCreateReply, error) {
@@ -75,7 +75,7 @@ func (c *serviceClient) MemclntKeepalive(ctx context.Context, in *MemclntKeepali
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) MemclntReadTimeout(ctx context.Context, in *MemclntReadTimeout) error {
@@ -108,7 +108,7 @@ func (c *serviceClient) RPCCall(ctx context.Context, in *RPCCall) (*RPCCallReply
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) RxThreadExit(ctx context.Context, in *RxThreadExit) error {
@@ -129,7 +129,7 @@ func (c *serviceClient) SockInitShm(ctx context.Context, in *SockInitShm) (*Sock
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) SockclntCreate(ctx context.Context, in *SockclntCreate) (*SockclntCreateReply, error) {