diff --git a/gitea/miscellaneous.go b/gitea/miscellaneous.go index 30aaee7..dc56177 100644 --- a/gitea/miscellaneous.go +++ b/gitea/miscellaneous.go @@ -11,3 +11,14 @@ type MarkdownOption struct { Context string Wiki bool } + +// ServerVersion wraps the version of the server +type ServerVersion struct { + Version string +} + +// ServerVersion returns the version of the server +func (c *Client) ServerVersion() (string, error) { + v := ServerVersion{} + return v.Version, c.getParsedResponse("GET", "/api/v1/version", nil, nil, &v) +}