Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
go-gitlab
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
go-gitlab
Commits
753bbd7a
Commit
753bbd7a
authored
Sep 22, 2017
by
jbguerraz
Committed by
Sander van Harmelen
Sep 22, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates list issues and merge requests methods and options (#212)
parent
811c11f2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
25 deletions
+93
-25
issues.go
issues.go
+35
-19
merge_requests.go
merge_requests.go
+58
-6
No files found.
issues.go
View file @
753bbd7a
...
...
@@ -87,12 +87,17 @@ func (l *Labels) MarshalJSON() ([]byte, error) {
// GitLab API docs: https://docs.gitlab.com/ce/api/issues.html#list-issues
type
ListIssuesOptions
struct
{
ListOptions
IIDs
[]
int
`url:"iids[],omitempty" json:"iids,omitempty"`
State
*
string
`url:"state,omitempty" json:"state,omitempty"`
Labels
Labels
`url:"labels,comma,omitempty" json:"labels,omitempty"`
Milestone
*
string
`url:"milestone,omitempty" json:"milestone,omitempty"`
OrderBy
*
string
`url:"order_by,omitempty" json:"order_by,omitempty"`
Sort
*
string
`url:"sort,omitempty" json:"sort,omitempty"`
State
*
string
`url:"state,omitempty" json:"state,omitempty"`
Labels
Labels
`url:"labels,comma,omitempty" json:"labels,omitempty"`
Milestone
*
string
`url:"milestone,omitempty" json:"milestone,omitempty"`
Scope
*
string
`url:"scope,omitempty" json:"scope,omitempty"`
AuthorID
*
int
`url:"author_id,omitempty" json:"author_id,omitempty"`
AssigneeID
*
int
`url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
MyReactionEmoji
*
string
`url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"`
IIDs
[]
int
`url:"iids[],omitempty" json:"iids,omitempty"`
OrderBy
*
string
`url:"order_by,omitempty" json:"order_by,omitempty"`
Sort
*
string
`url:"sort,omitempty" json:"sort,omitempty"`
Search
*
string
`url:"search,omitempty" json:"search,omitempty"`
}
// ListIssues gets all issues created by authenticated user. This function
...
...
@@ -119,12 +124,17 @@ func (s *IssuesService) ListIssues(opt *ListIssuesOptions, options ...OptionFunc
// GitLab API docs: https://docs.gitlab.com/ce/api/issues.html#list-group-issues
type
ListGroupIssuesOptions
struct
{
ListOptions
IIDs
[]
int
`url:"iids[],omitempty" json:"iids,omitempty"`
State
*
string
`url:"state,omitempty" json:"state,omitempty"`
Labels
Labels
`url:"labels,comma,omitempty" json:"labels,omitempty"`
Milestone
*
string
`url:"milestone,omitempty" json:"milestone,omitempty"`
OrderBy
*
string
`url:"order_by,omitempty" json:"order_by,omitempty"`
Sort
*
string
`url:"sort,omitempty" json:"sort,omitempty"`
State
*
string
`url:"state,omitempty" json:"state,omitempty"`
Labels
Labels
`url:"labels,comma,omitempty" json:"labels,omitempty"`
IIDs
[]
int
`url:"iids[],omitempty" json:"iids,omitempty"`
Milestone
*
string
`url:"milestone,omitempty" json:"milestone,omitempty"`
Scope
*
string
`url:"scope,omitempty" json:"scope,omitempty"`
AuthorID
*
int
`url:"author_id,omitempty" json:"author_id,omitempty"`
AssigneeID
*
int
`url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
MyReactionEmoji
*
string
`url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"`
OrderBy
*
string
`url:"order_by,omitempty" json:"order_by,omitempty"`
Sort
*
string
`url:"sort,omitempty" json:"sort,omitempty"`
Search
*
string
`url:"search,omitempty" json:"search,omitempty"`
}
// ListGroupIssues gets a list of group issues. This function accepts
...
...
@@ -157,13 +167,19 @@ func (s *IssuesService) ListGroupIssues(pid interface{}, opt *ListGroupIssuesOpt
// GitLab API docs: https://docs.gitlab.com/ce/api/issues.html#list-project-issues
type
ListProjectIssuesOptions
struct
{
ListOptions
IIDs
[]
int
`url:"iids[],omitempty" json:"iids,omitempty"`
State
*
string
`url:"state,omitempty" json:"state,omitempty"`
Labels
Labels
`url:"labels,comma,omitempty" json:"labels,omitempty"`
Milestone
*
string
`url:"milestone,omitempty" json:"milestone,omitempty"`
OrderBy
*
string
`url:"order_by,omitempty" json:"order_by,omitempty"`
Sort
*
string
`url:"sort,omitempty" json:"sort,omitempty"`
Search
*
string
`url:"search,omitempty" json:"search,omitempty"`
IIDs
[]
int
`url:"iids[],omitempty" json:"iids,omitempty"`
State
*
string
`url:"state,omitempty" json:"state,omitempty"`
Labels
Labels
`url:"labels,comma,omitempty" json:"labels,omitempty"`
Milestone
*
string
`url:"milestone,omitempty" json:"milestone,omitempty"`
Scope
*
string
`url:"scope,omitempty" json:"scope,omitempty"`
AuthorID
*
int
`url:"author_id,omitempty" json:"author_id,omitempty"`
AssigneeID
*
int
`url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
MyReactionEmoji
*
string
`url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"`
OrderBy
*
string
`url:"order_by,omitempty" json:"order_by,omitempty"`
Sort
*
string
`url:"sort,omitempty" json:"sort,omitempty"`
Search
*
string
`url:"search,omitempty" json:"search,omitempty"`
CreatedAfter
*
time
.
Time
`url:"created_after,omitempty" json:"created_after,omitempty"`
CreatedBefore
*
time
.
Time
`url:"created_before,omitempty" json:"created_before,omitempty"`
}
// ListProjectIssues gets a list of project issues. This function accepts
...
...
merge_requests.go
View file @
753bbd7a
...
...
@@ -107,20 +107,72 @@ func (m MergeRequest) String() string {
// https://docs.gitlab.com/ce/api/merge_requests.html#list-merge-requests
type
ListMergeRequestsOptions
struct
{
ListOptions
IIDs
[]
int
`url:"iids[],omitempty" json:"iids,omitempty"`
State
*
string
`url:"state,omitempty" json:"state,omitempty"`
OrderBy
*
string
`url:"order_by,omitempty" json:"order_by,omitempty"`
Sort
*
string
`url:"sort,omitempty" json:"sort,omitempty"`
State
*
string
`url:"state,omitempty" json:"state,omitempty"`
OrderBy
*
string
`url:"order_by,omitempty" json:"order_by,omitempty"`
Sort
*
string
`url:"sort,omitempty" json:"sort,omitempty"`
Milestone
*
string
`url:"milestone,omitempty" json:"milestone,omitempty"`
View
*
string
`url:"view,omitempty" json:"view,omitempty"`
Labels
Labels
`url:"labels,omitempty" json:"labels,omitempty"`
CreatedAfter
*
time
.
Time
`url:"created_after,omitempty" json:"created_after,omitempty"`
CreatedBefore
*
time
.
Time
`url:"created_before,omitempty" json:"created_before,omitempty"`
Scope
*
string
`url:"scope,omitempty" json:"scope,omitempty"`
AuthorID
*
int
`url:"author_id,omitempty" json:"author_id,omitempty"`
AssigneeID
*
int
`url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
MyReactionEmoji
*
string
`url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"`
}
// ListMergeRequests gets all merge requests
for this project
. The state
// ListMergeRequests gets all merge requests. The state
// parameter can be used to get only merge requests with a given state (opened,
// closed, or merged) or all of them (all). The pagination parameters page and
// per_page can be used to restrict the list of merge requests.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/merge_requests.html#list-merge-requests
func
(
s
*
MergeRequestsService
)
ListMergeRequests
(
pid
interface
{},
opt
*
ListMergeRequestsOptions
,
options
...
OptionFunc
)
([]
*
MergeRequest
,
*
Response
,
error
)
{
func
(
s
*
MergeRequestsService
)
ListMergeRequests
(
opt
*
ListMergeRequestsOptions
,
options
...
OptionFunc
)
([]
*
MergeRequest
,
*
Response
,
error
)
{
req
,
err
:=
s
.
client
.
NewRequest
(
"GET"
,
"merge_requests"
,
opt
,
options
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
var
m
[]
*
MergeRequest
resp
,
err
:=
s
.
client
.
Do
(
req
,
&
m
)
if
err
!=
nil
{
return
nil
,
resp
,
err
}
return
m
,
resp
,
err
}
// ListProjectMergeRequestsOptions represents the available ListMergeRequests()
// options.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/merge_requests.html#list-project-merge-requests
type
ListProjectMergeRequestsOptions
struct
{
ListOptions
IIDs
[]
int
`url:"iids[],omitempty" json:"iids,omitempty"`
State
*
string
`url:"state,omitempty" json:"state,omitempty"`
OrderBy
*
string
`url:"order_by,omitempty" json:"order_by,omitempty"`
Sort
*
string
`url:"sort,omitempty" json:"sort,omitempty"`
Milestone
*
string
`url:"milestone,omitempty" json:"milestone,omitempty"`
View
*
string
`url:"view,omitempty" json:"view,omitempty"`
Labels
Labels
`url:"labels,omitempty" json:"labels,omitempty"`
CreatedAfter
*
time
.
Time
`url:"created_after,omitempty" json:"created_after,omitempty"`
CreatedBefore
*
time
.
Time
`url:"created_before,omitempty" json:"created_before,omitempty"`
Scope
*
string
`url:"scope,omitempty" json:"scope,omitempty"`
AuthorID
*
int
`url:"author_id,omitempty" json:"author_id,omitempty"`
AssigneeID
*
int
`url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
MyReactionEmoji
*
string
`url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"`
}
// ListProjectMergeRequests gets all merge requests for this project. The state
// parameter can be used to get only merge requests with a given state (opened,
// closed, or merged) or all of them (all). The pagination parameters page and
// per_page can be used to restrict the list of merge requests.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/merge_requests.html#list-merge-requests
func
(
s
*
MergeRequestsService
)
ListProjectMergeRequests
(
pid
interface
{},
opt
*
ListProjectMergeRequestsOptions
,
options
...
OptionFunc
)
([]
*
MergeRequest
,
*
Response
,
error
)
{
project
,
err
:=
parseID
(
pid
)
if
err
!=
nil
{
return
nil
,
nil
,
err
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment