config: Accept more address format + unit test (#3915)

checkURL() is a generic function to check if a passed address
is valid. This commit adds support for addresses like `m1`
and `172.16.3.1` which is needed in MySQL and NATS. This commit
also adds tests.
This commit is contained in:
Anis Elleuch
2017-03-16 19:44:01 +01:00
committed by Harshavardhana
parent f3334159a4
commit 8426cf9aec
8 changed files with 39 additions and 12 deletions
+1 -1
View File
@@ -88,7 +88,7 @@ func (p *postgreSQLNotify) Validate() error {
if !p.Enable {
return nil
}
if _, err := checkNetURL(p.Host); err != nil {
if _, err := checkURL(p.Host); err != nil {
return err
}
return nil