munin-miflora: refactor helper into common, add RSSI and timing metrics

This commit is contained in:
cn
2018-12-22 13:56:49 +01:00
parent 3b4627f988
commit c66b3d2f75
4 changed files with 87 additions and 25 deletions
+14
View File
@@ -0,0 +1,14 @@
package common
import (
"regexp"
"strings"
)
const peripheralAddressAllowedChars = "[^a-z0-9]+"
var peripheralAddressAllowedCharsPattern = regexp.MustCompile(peripheralAddressAllowedChars)
func MifloraGetAlphaNumericID(peripheralAddress string) string {
return peripheralAddressAllowedCharsPattern.ReplaceAllString(strings.ToLower(peripheralAddress), "")
}