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
0db4706e
Commit
0db4706e
authored
Nov 22, 2023
by
Michael Yang
Browse files
api: add version api handler
parent
1ebdbd96
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
api/client.go
api/client.go
+12
-0
No files found.
api/client.go
View file @
0db4706e
...
@@ -311,3 +311,15 @@ func (c *Client) CreateBlob(ctx context.Context, digest string, r io.Reader) err
...
@@ -311,3 +311,15 @@ func (c *Client) CreateBlob(ctx context.Context, digest string, r io.Reader) err
return
nil
return
nil
}
}
func
(
c
*
Client
)
Version
(
ctx
context
.
Context
)
(
string
,
error
)
{
var
version
struct
{
Version
string
`json:"version"`
}
if
err
:=
c
.
do
(
ctx
,
http
.
MethodGet
,
"/api/version"
,
nil
,
&
version
);
err
!=
nil
{
return
""
,
err
}
return
version
.
Version
,
nil
}
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