mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-05 16:57:51 +08:00
17 lines
405 B
Go
17 lines
405 B
Go
package controller
|
|
|
|
import (
|
|
"errors"
|
|
"regexp"
|
|
)
|
|
|
|
var (
|
|
errInvalidNodeName = errors.New("Node name must be alphanumderic and/or dashes")
|
|
errInvalidExtClientID = errors.New("Ext client ID must be alphanumderic and/or dashes")
|
|
)
|
|
|
|
// allow only dashes and alphaneumeric for ext client and node names
|
|
func validName(name string) bool {
|
|
return regexp.MustCompile("^[a-zA-Z0-9-]+$").MatchString(name)
|
|
}
|