AlertingNG: base API implementation (#31824)
* AlertingNG: base API implementation * Pass the interface instead of the base impl * Ruler mock draft (WIP) * Update alerting-api dependency * Improve mock implementation
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"regexp"
|
||||
)
|
||||
|
||||
var searchRegex = regexp.MustCompile(`\{(\w+)\}`)
|
||||
|
||||
func toMacaronPath(path string) string {
|
||||
return string(searchRegex.ReplaceAllFunc([]byte(path), func(s []byte) []byte {
|
||||
m := string(s[1 : len(s)-1])
|
||||
return []byte(fmt.Sprintf(":%s", m))
|
||||
}))
|
||||
}
|
||||
Reference in New Issue
Block a user