mirror of
https://github.com/hanzoai/krakend-otel.git
synced 2026-09-30 22:49:38 +00:00
17 lines
294 B
Go
17 lines
294 B
Go
package config
|
|
|
|
import (
|
|
"regexp"
|
|
"strings"
|
|
)
|
|
|
|
var templatedURLPattern = regexp.MustCompile(`{{\.(.*?)}}`)
|
|
|
|
func NormalizeURLPattern(u string) string {
|
|
s := templatedURLPattern.ReplaceAllStringFunc(u,
|
|
func(x string) string {
|
|
return ":" + strings.ToLower(x[3:len(x)-2])
|
|
})
|
|
return s
|
|
}
|