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 @@
# Folders
_obj
_test
.idea
# Architecture specific extensions/prefixes
*.[568vq]
......
......@@ -55,7 +55,11 @@ func (t Tag) String() string {
//
// GitLab API docs:
// 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
// alphabetical order.
......
......@@ -16,7 +16,7 @@ func TestListTags(t *testing.T) {
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)
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