|
|
@ -506,22 +506,6 @@ func (s *peerRESTServer) ProcOBDInfoHandler(w http.ResponseWriter, r *http.Reque |
|
|
|
logger.LogIf(ctx, gob.NewEncoder(w).Encode(info)) |
|
|
|
logger.LogIf(ctx, gob.NewEncoder(w).Encode(info)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// LogOBDInfoHandler - returns Log OBD info.
|
|
|
|
|
|
|
|
func (s *peerRESTServer) LogOBDInfoHandler(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
|
|
|
if !s.IsValid(w, r) { |
|
|
|
|
|
|
|
s.writeErrorResponse(w, errors.New("Invalid request")) |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ctx, cancel := context.WithCancel(r.Context()) |
|
|
|
|
|
|
|
defer cancel() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
info := getLocalLogOBD(ctx, r) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
defer w.(http.Flusher).Flush() |
|
|
|
|
|
|
|
logger.LogIf(ctx, gob.NewEncoder(w).Encode(info)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// MemOBDInfoHandler - returns Mem OBD info.
|
|
|
|
// MemOBDInfoHandler - returns Mem OBD info.
|
|
|
|
func (s *peerRESTServer) MemOBDInfoHandler(w http.ResponseWriter, r *http.Request) { |
|
|
|
func (s *peerRESTServer) MemOBDInfoHandler(w http.ResponseWriter, r *http.Request) { |
|
|
|
if !s.IsValid(w, r) { |
|
|
|
if !s.IsValid(w, r) { |
|
|
@ -1040,7 +1024,6 @@ func registerPeerRESTHandlers(router *mux.Router) { |
|
|
|
subrouter.Methods(http.MethodPost).Path(peerRESTVersionPrefix + peerRESTMethodGetLocks).HandlerFunc(httpTraceHdrs(server.GetLocksHandler)) |
|
|
|
subrouter.Methods(http.MethodPost).Path(peerRESTVersionPrefix + peerRESTMethodGetLocks).HandlerFunc(httpTraceHdrs(server.GetLocksHandler)) |
|
|
|
subrouter.Methods(http.MethodPost).Path(peerRESTVersionPrefix + peerRESTMethodServerInfo).HandlerFunc(httpTraceHdrs(server.ServerInfoHandler)) |
|
|
|
subrouter.Methods(http.MethodPost).Path(peerRESTVersionPrefix + peerRESTMethodServerInfo).HandlerFunc(httpTraceHdrs(server.ServerInfoHandler)) |
|
|
|
subrouter.Methods(http.MethodPost).Path(peerRESTVersionPrefix + peerRESTMethodProcOBDInfo).HandlerFunc(httpTraceHdrs(server.ProcOBDInfoHandler)) |
|
|
|
subrouter.Methods(http.MethodPost).Path(peerRESTVersionPrefix + peerRESTMethodProcOBDInfo).HandlerFunc(httpTraceHdrs(server.ProcOBDInfoHandler)) |
|
|
|
subrouter.Methods(http.MethodPost).Path(peerRESTVersionPrefix + peerRESTMethodLogOBDInfo).HandlerFunc(httpTraceHdrs(server.LogOBDInfoHandler)) |
|
|
|
|
|
|
|
subrouter.Methods(http.MethodPost).Path(peerRESTVersionPrefix + peerRESTMethodMemOBDInfo).HandlerFunc(httpTraceHdrs(server.MemOBDInfoHandler)) |
|
|
|
subrouter.Methods(http.MethodPost).Path(peerRESTVersionPrefix + peerRESTMethodMemOBDInfo).HandlerFunc(httpTraceHdrs(server.MemOBDInfoHandler)) |
|
|
|
subrouter.Methods(http.MethodPost).Path(peerRESTVersionPrefix + peerRESTMethodOsInfoOBDInfo).HandlerFunc(httpTraceHdrs(server.OsOBDInfoHandler)) |
|
|
|
subrouter.Methods(http.MethodPost).Path(peerRESTVersionPrefix + peerRESTMethodOsInfoOBDInfo).HandlerFunc(httpTraceHdrs(server.OsOBDInfoHandler)) |
|
|
|
subrouter.Methods(http.MethodPost).Path(peerRESTVersionPrefix + peerRESTMethodDiskHwOBDInfo).HandlerFunc(httpTraceHdrs(server.DiskHwOBDInfoHandler)) |
|
|
|
subrouter.Methods(http.MethodPost).Path(peerRESTVersionPrefix + peerRESTMethodDiskHwOBDInfo).HandlerFunc(httpTraceHdrs(server.DiskHwOBDInfoHandler)) |
|
|
|