mirror of
https://github.com/onepanelio/onepanel.git
synced 2025-10-06 06:06:50 +08:00
15 lines
264 B
Go
15 lines
264 B
Go
package validate
|
|
|
|
import (
|
|
"github.com/asaskevich/govalidator"
|
|
"strings"
|
|
)
|
|
|
|
func IsDNSHost(str string) bool {
|
|
if str == "" || len(strings.Replace(str, ".", "", -1)) > 63 {
|
|
// constraints already violated
|
|
return false
|
|
}
|
|
return govalidator.IsDNSName(str)
|
|
}
|