Commit 298c996e authored by Josh Yan's avatar Josh Yan
Browse files

added IsValidNamespace function

parent 0fc0cfc6
...@@ -251,6 +251,16 @@ func (n Name) DisplayShortest() string { ...@@ -251,6 +251,16 @@ func (n Name) DisplayShortest() string {
return sb.String() return sb.String()
} }
func IsValidNamespace(namespace string) bool {
name := Name{
Host: "h",
Model: "m",
Namespace: namespace,
Tag: "t",
}
return name.IsValid()
}
// IsValid reports whether all parts of the name are present and valid. The // IsValid reports whether all parts of the name are present and valid. The
// digest is a special case, and is checked for validity only if present. // digest is a special case, and is checked for validity only if present.
func (n Name) IsValid() bool { func (n Name) IsValid() bool {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment