vendor: update yunion.io/x/pkg

This commit is contained in:
Yousong Zhou
2019-07-26 03:43:07 +00:00
parent 8f0e7c8269
commit 543bb89a9a
4 changed files with 30 additions and 7 deletions
+1 -1
View File
@@ -160,7 +160,7 @@ require (
sigs.k8s.io/yaml v1.1.0 // indirect
yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051
yunion.io/x/log v0.0.0-20190629062853-9f6483a7103d
yunion.io/x/pkg v0.0.0-20190628082551-f4033ba2ea30
yunion.io/x/pkg v0.0.0-20190726033806-b564cfdcc224
yunion.io/x/sqlchemy v0.0.0-20190704155352-6aff6c803fda
yunion.io/x/structarg v0.0.0-20190717142057-5caf182cbb4d
)
+2
View File
@@ -496,6 +496,8 @@ yunion.io/x/pkg v0.0.0-20190620104149-945c25821dbf h1:OsKC+2ghZHwp+Ztm/MwKlLKKRi
yunion.io/x/pkg v0.0.0-20190620104149-945c25821dbf/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20190628082551-f4033ba2ea30 h1:6CkrwtX4xeYFqqpdWtQPAVqEnD3aEivPLOLzNKNPAB0=
yunion.io/x/pkg v0.0.0-20190628082551-f4033ba2ea30/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20190726033806-b564cfdcc224 h1:dAeUov/CtKcPaOapGVG7+NRqmUF2fr2O3Onb+ID5HS4=
yunion.io/x/pkg v0.0.0-20190726033806-b564cfdcc224/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/sqlchemy v0.0.0-20190704155352-6aff6c803fda h1:i+/3Hh+kVmPZM1P+j3wfViEzb0XlttWyNvDSYA5DDDU=
yunion.io/x/sqlchemy v0.0.0-20190704155352-6aff6c803fda/go.mod h1:FTdwPdGhMgh4E+UFXc9klI1Ok34fMuybTT+jLhOaIjI=
yunion.io/x/structarg v0.0.0-20190717142057-5caf182cbb4d h1:00kGV39weRaYPldUUh5mllj4aHcGMOZZx4m3CotRESw=
+2 -2
View File
@@ -369,11 +369,11 @@ github.com/mholt/caddy/onevent/hook
# github.com/miekg/dns v1.1.1
github.com/miekg/dns
# github.com/minio/minio-go v6.0.14+incompatible
github.com/minio/minio-go/pkg/s3utils
github.com/minio/minio-go
github.com/minio/minio-go/pkg/credentials
github.com/minio/minio-go/pkg/encrypt
github.com/minio/minio-go/pkg/s3signer
github.com/minio/minio-go/pkg/s3utils
github.com/minio/minio-go/pkg/set
# github.com/mitchellh/go-homedir v1.1.0
github.com/mitchellh/go-homedir
@@ -746,7 +746,7 @@ yunion.io/x/jsonutils
# yunion.io/x/log v0.0.0-20190629062853-9f6483a7103d
yunion.io/x/log
yunion.io/x/log/hooks
# yunion.io/x/pkg v0.0.0-20190628082551-f4033ba2ea30
# yunion.io/x/pkg v0.0.0-20190726033806-b564cfdcc224
yunion.io/x/pkg/util/version
yunion.io/x/pkg/utils
yunion.io/x/pkg/util/regutils
+25 -4
View File
@@ -60,8 +60,7 @@ func init() {
COMPACT_MACADDR_REG = regexp.MustCompile(`^[0-9a-fA-F]{12}$`)
NSPTR_REG = regexp.MustCompile(`^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\.in-addr\.arpa$`)
NAME_REG = regexp.MustCompile(`^[a-zA-Z][a-zA-Z0-9._@-]*$`)
DOMAINNAME_REG = regexp.MustCompile(`^[a-zA-Z0-9-.]+$`)
DOMAINSRV_REG = regexp.MustCompile(`^[a-zA-Z0-9-._]+$`)
DOMAINNAME_REG = regexp.MustCompile(`^([a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62}){1}(\.[a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62})*[\._]?$`)
SIZE_REG = regexp.MustCompile(`^\d+[bBkKmMgG]?$`)
MONTH_REG = regexp.MustCompile(`^\d{4}-\d{2}$`)
DATE_REG = regexp.MustCompile(`^\d{4}-\d{2}-\d{2}$`)
@@ -142,11 +141,33 @@ func MatchName(str string) bool {
}
func MatchDomainName(str string) bool {
return DOMAINNAME_REG.MatchString(str)
if str == "" || len(strings.Replace(str, ".", "", -1)) > 255 {
return false
}
return !MatchIPAddr(str) && DOMAINNAME_REG.MatchString(str)
}
func MatchDomainSRV(str string) bool {
return DOMAINSRV_REG.MatchString(str)
if !MatchDomainName(str) {
return false
}
// Ref: https://tools.ietf.org/html/rfc2782
//
// _Service._Proto.Name
parts := strings.SplitN(str, ".", 3)
if len(parts) != 3 {
return false
}
for i := 0; i < 2; i++ {
if len(parts[i]) < 2 || parts[i][0] != '_' {
return false
}
}
if len(parts[2]) == 0 {
return false
}
return true
}
func MatchSize(str string) bool {