Commit 4f616cbc authored by Peter Shilo's avatar Peter Shilo Committed by Sander van Harmelen

listtagopts added params (#436)

* listtagopts added params

* test fix + gitignore
parent 81955e08
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
# Folders # Folders
_obj _obj
_test _test
.idea
# Architecture specific extensions/prefixes # Architecture specific extensions/prefixes
*.[568vq] *.[568vq]
......
...@@ -55,7 +55,11 @@ func (t Tag) String() string { ...@@ -55,7 +55,11 @@ func (t Tag) String() string {
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/tags.html#list-project-repository-tags // https://docs.gitlab.com/ce/api/tags.html#list-project-repository-tags
type ListTagsOptions ListOptions type ListTagsOptions struct {
ListOptions
OrderBy *string `url:"order_by,omitempty" json:"order_by,omitempty"`
Sort *string `url:"sort,omitempty" json:"sort,omitempty"`
}
// ListTags gets a list of tags from a project, sorted by name in reverse // ListTags gets a list of tags from a project, sorted by name in reverse
// alphabetical order. // alphabetical order.
......
...@@ -16,7 +16,7 @@ func TestListTags(t *testing.T) { ...@@ -16,7 +16,7 @@ func TestListTags(t *testing.T) {
fmt.Fprint(w, `[{"name": "1.0.0"},{"name": "1.0.1"}]`) fmt.Fprint(w, `[{"name": "1.0.0"},{"name": "1.0.1"}]`)
}) })
opt := &ListTagsOptions{Page: 2, PerPage: 3} opt := &ListTagsOptions{ListOptions: ListOptions{Page:2, PerPage: 3}}
tags, _, err := client.Tags.ListTags(1, opt) tags, _, err := client.Tags.ListTags(1, opt)
if err != 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