live: various code cleanups (#37165)

This commit is contained in:
Alexander Emelin
2021-07-23 19:47:08 +03:00
committed by GitHub
parent 72cac20e1d
commit 32b74e75a3
3 changed files with 14 additions and 32 deletions
-16
View File
@@ -2,7 +2,6 @@ package livecontext
import (
"context"
"net/url"
"github.com/grafana/grafana/pkg/models"
)
@@ -24,21 +23,6 @@ func GetContextSignedUser(ctx context.Context) (*models.SignedInUser, bool) {
return nil, false
}
type valuesContextKey struct{}
func SetContextValues(ctx context.Context, values url.Values) context.Context {
ctx = context.WithValue(ctx, valuesContextKey{}, values)
return ctx
}
func GetContextValues(ctx context.Context) (url.Values, bool) {
if val := ctx.Value(valuesContextKey{}); val != nil {
values, ok := val.(url.Values)
return values, ok
}
return nil, false
}
type streamIDContextKey struct{}
func SetContextStreamID(ctx context.Context, streamID string) context.Context {