Commit 9376f0d6 authored by Stefan Warman's avatar Stefan Warman Committed by Sander van Harmelen

Added missing GetSingleTag method to TagService (#93)

parent 266a89f3
...@@ -68,6 +68,32 @@ func (s *TagsService) ListTags(pid interface{}) ([]*Tag, *Response, error) { ...@@ -68,6 +68,32 @@ func (s *TagsService) ListTags(pid interface{}) ([]*Tag, *Response, error) {
return t, resp, err return t, resp, err
} }
// Get a specific repository tag determined by its name. It returns 200 together
// with the tag information if the tag exists. It returns 404 if the tag does not exist.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/tags.html#get-a-single-repository-tag
func (s *TagsService) GetSingleTag(pid interface{}, tag string) (*Tag, *Response, error) {
project, err := parseID(pid)
if err != nil {
return nil, nil, err
}
u := fmt.Sprintf("projects/%s/repository/tags/%s", url.QueryEscape(project), tag)
req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
return nil, nil, err
}
var t *Tag
resp, err := s.client.Do(req, &t)
if err != nil {
return nil, resp, err
}
return t, resp, err
}
// CreateTagOptions represents the available CreateTag() options. // CreateTagOptions represents the available CreateTag() options.
// //
// GitLab API docs: // GitLab API docs:
......
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