Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
298c996e
Commit
298c996e
authored
May 30, 2024
by
Josh Yan
Browse files
added IsValidNamespace function
parent
0fc0cfc6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
types/model/name.go
types/model/name.go
+10
-0
No files found.
types/model/name.go
View file @
298c996e
...
@@ -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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment