Commit 16529bb9 authored by Andrea Funtò's avatar Andrea Funtò Committed by Sander van Harmelen

Added Version API support (#172)

* Added Version API support

* #172 Version API: fixes as per maintainer's requests
parent 259cc194
......@@ -188,6 +188,7 @@ type Client struct {
TimeStats *TimeStatsService
Todos *TodosService
Users *UsersService
Version *VersionService
}
// ListOptions specifies the optional parameters to various List methods that
......@@ -252,6 +253,7 @@ func newClient(httpClient *http.Client, tokenType tokenType, token string) *Clie
c.TimeStats = &TimeStatsService{client: c}
c.Todos = &TodosService{client: c}
c.Users = &UsersService{client: c}
c.Version = &VersionService{client: c}
return c
}
......
......@@ -19,16 +19,14 @@ package gitlab
// VersionService handles communication with the GitLab server instance to
// retrieve its version information via the GitLab API.
//
// GitLab API docs:
// https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/version.md
// GitLab API docs: https://docs.gitlab.com/ce/api/version.md
type VersionService struct {
client *Client
}
// Version represents a GitLab instance version.
//
// GitLab API docs:
// https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/version.md
// GitLab API docs: https://docs.gitlab.com/ce/api/version.md
type Version struct {
Version string `json:"version"`
Revision string `json:"revision"`
......@@ -41,8 +39,7 @@ func (s Version) String() string {
// GetVersion gets a GitLab server instance version; it is only available to
// authenticated users.
//
// GitLab API docs:
// https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/version.md
// GitLab API docs: https://docs.gitlab.com/ce/api/version.md
func (s *VersionService) GetVersion() (*Version, *Response, error) {
req, err := s.client.NewRequest("GET", "version", nil, nil)
if err != nil {
......
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