yanic/database/graphite/utils.go
Igor Scheller b5a694a7a4 [BUGFIX] Fixed Graphite naming (#72)
* Bugfix: Graphite compatibility with meshviewer

* Bugfix: Bad message: Router type not sanitized

* Refactoring: Implemented replaceInvalidChars function for Graphite
2017-08-06 12:39:16 +02:00

12 lines
201 B
Go

package graphite
import (
"regexp"
)
var reInvalidChars = regexp.MustCompile("(?i)[^a-z0-9\\-]")
func replaceInvalidChars(name string) string {
return reInvalidChars.ReplaceAllString(name, "_")
}