summaryrefslogtreecommitdiffstats
path: root/binapi/syslog
diff options
context:
space:
mode:
Diffstat (limited to 'binapi/syslog')
-rw-r--r--binapi/syslog/syslog.ba.go4
-rw-r--r--binapi/syslog/syslog_rest.ba.go88
-rw-r--r--binapi/syslog/syslog_rpc.ba.go10
3 files changed, 7 insertions, 95 deletions
diff --git a/binapi/syslog/syslog.ba.go b/binapi/syslog/syslog.ba.go
index cf8f754..e3b7ef5 100644
--- a/binapi/syslog/syslog.ba.go
+++ b/binapi/syslog/syslog.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/syslog.api.json
// Package syslog contains generated bindings for API file syslog.api.
diff --git a/binapi/syslog/syslog_rest.ba.go b/binapi/syslog/syslog_rest.ba.go
deleted file mode 100644
index e9098e8..0000000
--- a/binapi/syslog/syslog_rest.ba.go
+++ /dev/null
@@ -1,88 +0,0 @@
-// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
-
-package syslog
-
-import (
- "encoding/json"
- "io/ioutil"
- "net/http"
-)
-
-func RESTHandler(rpc RPCService) http.Handler {
- mux := http.NewServeMux()
- mux.HandleFunc("/syslog_get_filter", func(w http.ResponseWriter, req *http.Request) {
- var request = new(SyslogGetFilter)
- reply, err := rpc.SyslogGetFilter(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("/syslog_get_sender", func(w http.ResponseWriter, req *http.Request) {
- var request = new(SyslogGetSender)
- reply, err := rpc.SyslogGetSender(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("/syslog_set_filter", func(w http.ResponseWriter, req *http.Request) {
- var request = new(SyslogSetFilter)
- 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.SyslogSetFilter(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("/syslog_set_sender", func(w http.ResponseWriter, req *http.Request) {
- var request = new(SyslogSetSender)
- 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.SyslogSetSender(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/syslog/syslog_rpc.ba.go b/binapi/syslog/syslog_rpc.ba.go
index 385960f..da005b3 100644
--- a/binapi/syslog/syslog_rpc.ba.go
+++ b/binapi/syslog/syslog_rpc.ba.go
@@ -8,7 +8,7 @@ import (
api "git.fd.io/govpp.git/api"
)
-// RPCService defines RPC service syslog.
+// RPCService defines RPC service syslog.
type RPCService interface {
SyslogGetFilter(ctx context.Context, in *SyslogGetFilter) (*SyslogGetFilterReply, error)
SyslogGetSender(ctx context.Context, in *SyslogGetSender) (*SyslogGetSenderReply, error)
@@ -30,7 +30,7 @@ func (c *serviceClient) SyslogGetFilter(ctx context.Context, in *SyslogGetFilter
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) SyslogGetSender(ctx context.Context, in *SyslogGetSender) (*SyslogGetSenderReply, error) {
@@ -39,7 +39,7 @@ func (c *serviceClient) SyslogGetSender(ctx context.Context, in *SyslogGetSender
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) SyslogSetFilter(ctx context.Context, in *SyslogSetFilter) (*SyslogSetFilterReply, error) {
@@ -48,7 +48,7 @@ func (c *serviceClient) SyslogSetFilter(ctx context.Context, in *SyslogSetFilter
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) SyslogSetSender(ctx context.Context, in *SyslogSetSender) (*SyslogSetSenderReply, error) {
@@ -57,5 +57,5 @@ func (c *serviceClient) SyslogSetSender(ctx context.Context, in *SyslogSetSender
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}