aboutsummaryrefslogtreecommitdiffstats
path: root/binapi/trace
diff options
context:
space:
mode:
Diffstat (limited to 'binapi/trace')
-rw-r--r--binapi/trace/trace.ba.go4
-rw-r--r--binapi/trace/trace_rest.ba.go65
-rw-r--r--binapi/trace/trace_rpc.ba.go8
3 files changed, 6 insertions, 71 deletions
diff --git a/binapi/trace/trace.ba.go b/binapi/trace/trace.ba.go
index 9bc330b..a789b4f 100644
--- a/binapi/trace/trace.ba.go
+++ b/binapi/trace/trace.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/trace.api.json
// Package trace contains generated bindings for API file trace.api.
diff --git a/binapi/trace/trace_rest.ba.go b/binapi/trace/trace_rest.ba.go
deleted file mode 100644
index d7d2244..0000000
--- a/binapi/trace/trace_rest.ba.go
+++ /dev/null
@@ -1,65 +0,0 @@
-// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
-
-package trace
-
-import (
- "encoding/json"
- "io/ioutil"
- "net/http"
-)
-
-func RESTHandler(rpc RPCService) http.Handler {
- mux := http.NewServeMux()
- mux.HandleFunc("/trace_profile_add", func(w http.ResponseWriter, req *http.Request) {
- var request = new(TraceProfileAdd)
- 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.TraceProfileAdd(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("/trace_profile_del", func(w http.ResponseWriter, req *http.Request) {
- var request = new(TraceProfileDel)
- reply, err := rpc.TraceProfileDel(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("/trace_profile_show_config", func(w http.ResponseWriter, req *http.Request) {
- var request = new(TraceProfileShowConfig)
- reply, err := rpc.TraceProfileShowConfig(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/trace/trace_rpc.ba.go b/binapi/trace/trace_rpc.ba.go
index 09bf889..e3f1eca 100644
--- a/binapi/trace/trace_rpc.ba.go
+++ b/binapi/trace/trace_rpc.ba.go
@@ -8,7 +8,7 @@ import (
api "git.fd.io/govpp.git/api"
)
-// RPCService defines RPC service trace.
+// RPCService defines RPC service trace.
type RPCService interface {
TraceProfileAdd(ctx context.Context, in *TraceProfileAdd) (*TraceProfileAddReply, error)
TraceProfileDel(ctx context.Context, in *TraceProfileDel) (*TraceProfileDelReply, error)
@@ -29,7 +29,7 @@ func (c *serviceClient) TraceProfileAdd(ctx context.Context, in *TraceProfileAdd
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) TraceProfileDel(ctx context.Context, in *TraceProfileDel) (*TraceProfileDelReply, error) {
@@ -38,7 +38,7 @@ func (c *serviceClient) TraceProfileDel(ctx context.Context, in *TraceProfileDel
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) TraceProfileShowConfig(ctx context.Context, in *TraceProfileShowConfig) (*TraceProfileShowConfigReply, error) {
@@ -47,5 +47,5 @@ func (c *serviceClient) TraceProfileShowConfig(ctx context.Context, in *TracePro
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}