Chore: Query endpoint refactor (#41637)

Get rid of using legacydata.RequestHandler in HTTPServer, /api/tsdb/query and pkg/expr 
with the goal of deprecating /api/tsdb/query and remove it completely eventually. This is 
the first step of cleaning up the HTTP API query endpoint.

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Alexander Emelin <frvzmb@gmail.com>
This commit is contained in:
Marcus Efraimsson
2021-11-29 14:21:54 +01:00
committed by GitHub
co-authored by Alexander Emelin
parent 6e8cc426d6
commit 8927a3ca20
10 changed files with 242 additions and 316 deletions
+10
View File
@@ -6,6 +6,7 @@ import (
"regexp"
"strings"
"time"
"unicode"
)
// StringsFallback2 returns the first of two not empty strings.
@@ -108,3 +109,12 @@ func ToCamelCase(str string) string {
return strings.Join(finalParts, "")
}
func Capitalize(s string) string {
if len(s) == 0 {
return s
}
r := []rune(s)
r[0] = unicode.ToUpper(r[0])
return string(r)
}