mirror of
https://github.com/gravitl/netmaker.git
synced 2024-11-15 14:20:25 +08:00
16 lines
399 B
Go
16 lines
399 B
Go
package controller
|
|
|
|
import (
|
|
"errors"
|
|
"regexp"
|
|
)
|
|
|
|
var (
|
|
errInvalidExtClientPubKey = errors.New("incorrect ext client public key")
|
|
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)
|
|
}
|