2021-04-19 10:48:43 -05:00
|
|
|
package pushurl
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/url"
|
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
2021-05-13 04:01:20 -05:00
|
|
|
const (
|
|
|
|
unstableSchemaParam = "gf_live_unstable_schema"
|
|
|
|
frameFormatParam = "gf_live_frame_format"
|
|
|
|
)
|
|
|
|
|
2021-04-26 12:46:26 -05:00
|
|
|
// UnstableSchemaFromValues extracts unstable schema tip from url values.
|
|
|
|
func UnstableSchemaFromValues(values url.Values) bool {
|
2021-05-13 04:01:20 -05:00
|
|
|
return strings.ToLower(values.Get(unstableSchemaParam)) == "true" || values.Get(unstableSchemaParam) == "1"
|
2021-04-19 10:48:43 -05:00
|
|
|
}
|
|
|
|
|
2021-04-26 12:46:26 -05:00
|
|
|
// FrameFormatFromValues extracts frame format tip from url values.
|
2021-04-19 10:48:43 -05:00
|
|
|
func FrameFormatFromValues(values url.Values) string {
|
2021-05-13 04:01:20 -05:00
|
|
|
frameFormat := strings.ToLower(values.Get(frameFormatParam))
|
2021-04-19 10:48:43 -05:00
|
|
|
if frameFormat == "" {
|
2021-05-13 04:01:20 -05:00
|
|
|
frameFormat = "labels_column"
|
2021-04-19 10:48:43 -05:00
|
|
|
}
|
|
|
|
return frameFormat
|
|
|
|
}
|