Chore: replace macaron with web package (#40136)

* replace macaron with web package

* add web.go
This commit is contained in:
Serge Zaitsev
2021-10-11 14:30:59 +02:00
committed by GitHub
parent 78ebac0116
commit 57fcfd578d
70 changed files with 369 additions and 375 deletions
+4 -4
View File
@@ -14,7 +14,7 @@ import (
"github.com/grafana/grafana/pkg/setting"
liveDto "github.com/grafana/grafana-plugin-sdk-go/live"
"gopkg.in/macaron.v1"
"github.com/grafana/grafana/pkg/web"
)
var (
@@ -46,7 +46,7 @@ func (g *Gateway) Run(ctx context.Context) error {
}
func (g *Gateway) Handle(ctx *models.ReqContext) {
streamID := macaron.Params(ctx.Req)[":streamId"]
streamID := web.Params(ctx.Req)[":streamId"]
stream, err := g.GrafanaLive.ManagedStreamRunner.GetOrCreateStream(ctx.SignedInUser.OrgId, liveDto.ScopeStream, streamID)
if err != nil {
@@ -97,8 +97,8 @@ func (g *Gateway) Handle(ctx *models.ReqContext) {
}
func (g *Gateway) HandlePath(ctx *models.ReqContext) {
streamID := macaron.Params(ctx.Req)[":streamId"]
path := macaron.Params(ctx.Req)[":path"]
streamID := web.Params(ctx.Req)[":streamId"]
path := web.Params(ctx.Req)[":path"]
body, err := io.ReadAll(ctx.Req.Body)
if err != nil {