Live: Telegraf input modifiers (#32982)

This commit is contained in:
Alexander Emelin
2021-04-19 18:48:43 +03:00
committed by GitHub
parent f92b6518c5
commit d807fbc9e9
10 changed files with 187 additions and 57 deletions
+19
View File
@@ -0,0 +1,19 @@
package pushurl
import (
"net/url"
"strings"
)
func StableSchemaFromValues(values url.Values) bool {
key := "gf_live_stable_schema"
return strings.ToLower(values.Get(key)) == "true" || values.Get(key) == "1"
}
func FrameFormatFromValues(values url.Values) string {
frameFormat := strings.ToLower(values.Get("gf_live_frame_format"))
if frameFormat == "" {
frameFormat = "wide"
}
return frameFormat
}