mirror of
https://github.com/ollama/ollama.git
synced 2025-03-26 17:51:48 +01:00
added IsValidNamespace function
This commit is contained in:
parent
0fc0cfc6d2
commit
298c996e54
@ -251,6 +251,16 @@ func (n Name) DisplayShortest() 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
|
||||
// digest is a special case, and is checked for validity only if present.
|
||||
func (n Name) IsValid() bool {
|
||||
|
Loading…
x
Reference in New Issue
Block a user