live: add ws endpoint to push into pipeline (#41534)

This commit is contained in:
Alexander Emelin
2021-11-15 12:43:18 +03:00
committed by GitHub
parent f3f441f4ec
commit 1700b2c2f3
9 changed files with 334 additions and 213 deletions

View File

@@ -37,3 +37,18 @@ func GetContextStreamID(ctx context.Context) (string, bool) {
}
return "", false
}
type channelIDContextKey struct{}
func SetContextChannelID(ctx context.Context, channelID string) context.Context {
ctx = context.WithValue(ctx, channelIDContextKey{}, channelID)
return ctx
}
func GetContextChannelID(ctx context.Context) (string, bool) {
if val := ctx.Value(channelIDContextKey{}); val != nil {
values, ok := val.(string)
return values, ok
}
return "", false
}