Chore: Moves common and response into separate packages (#30298)

* Chore: moves common and response into separate packages

* Chore: moves common and response into separate packages

* Update pkg/api/utils/common.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Chore: changes after PR comments

* Chore: move wrap to routing package

* Chore: move functions in common to response package

* Chore: move functions in common to response package

* Chore: formats imports

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Hugo Häggmark
2021-01-15 14:43:20 +01:00
committed by GitHub
co-authored by Arve Knudsen
parent a94c256516
commit 3d41267fc4
51 changed files with 1321 additions and 1248 deletions
+3 -2
View File
@@ -5,6 +5,7 @@ import (
"strings"
"github.com/getsentry/sentry-go"
"github.com/grafana/grafana/pkg/api/response"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/models"
"github.com/inconshreveable/log15"
@@ -77,7 +78,7 @@ func (event *frontendSentryEvent) ToLogContext() log15.Ctx {
return ctx
}
func (hs *HTTPServer) logFrontendMessage(c *models.ReqContext, event frontendSentryEvent) Response {
func (hs *HTTPServer) logFrontendMessage(c *models.ReqContext, event frontendSentryEvent) response.Response {
var msg = "unknown"
if len(event.Message) > 0 {
@@ -99,5 +100,5 @@ func (hs *HTTPServer) logFrontendMessage(c *models.ReqContext, event frontendSen
frontendLogger.Info(msg, ctx)
}
return Success("ok")
return response.Success("ok")
}