1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
10 func HTTPHandler(rpc RPCService) http.Handler {
11 mux := http.NewServeMux()
12 mux.HandleFunc("/show_version", func(w http.ResponseWriter, req *http.Request) {
13 var request = new(ShowVersion)
14 reply, err := rpc.ShowVersion(req.Context(), request)
16 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
19 rep, err := json.MarshalIndent(reply, "", " ")
21 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
26 mux.HandleFunc("/show_vpe_system_time", func(w http.ResponseWriter, req *http.Request) {
27 var request = new(ShowVpeSystemTime)
28 reply, err := rpc.ShowVpeSystemTime(req.Context(), request)
30 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
33 rep, err := json.MarshalIndent(reply, "", " ")
35 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
40 return http.HandlerFunc(mux.ServeHTTP)