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
d804893e
Commit
d804893e
authored
Mar 30, 2019
by
Trond Nordheim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for managing issue boards
parent
1b3cf95a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
84 additions
and
0 deletions
+84
-0
boards.go
boards.go
+84
-0
No files found.
boards.go
View file @
d804893e
...
...
@@ -57,6 +57,90 @@ func (b BoardList) String() string {
return
Stringify
(
b
)
}
// CreateIssueBoardOptions represents the available CreateIssueBoard() options.
//
// GitLab API docs: https://docs.gitlab.com/ee/api/boards.html#create-a-board-starter
type
CreateIssueBoardOptions
struct
{
Name
*
string
`url:"name" json:"name"`
}
// CreateIssueBoard creates a new issue board.
//
// GitLab API docs: https://docs.gitlab.com/ee/api/boards.html#create-a-board-starter
func
(
s
*
IssueBoardsService
)
CreateIssueBoard
(
pid
interface
{},
opt
*
CreateIssueBoardOptions
,
options
...
OptionFunc
)
(
*
IssueBoard
,
*
Response
,
error
)
{
project
,
err
:=
parseID
(
pid
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
u
:=
fmt
.
Sprintf
(
"projects/%s/boards"
,
url
.
QueryEscape
(
project
))
req
,
err
:=
s
.
client
.
NewRequest
(
"POST"
,
u
,
opt
,
options
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
board
:=
new
(
IssueBoard
)
resp
,
err
:=
s
.
client
.
Do
(
req
,
board
)
if
err
!=
nil
{
return
nil
,
resp
,
err
}
return
board
,
resp
,
err
}
// UpdateIssueBoardOptions represents the available UpdateIssueBoard() options.
//
// GitLab API docs: https://docs.gitlab.com/ee/api/boards.html#update-a-board-starter
type
UpdateIssueBoardOptions
struct
{
Name
*
string
`url:"name,omitempty" json:"name,omitempty"`
AssigneeID
*
int
`url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
MilestoneID
*
int
`url:"milestone_id,omitempty" json:"milestone_id,omitempty"`
Labels
Labels
`url:"labels,omitempty" json:"labels,omitempty"`
Weight
*
int
`url:"weight,omitempty" json:"weight,omitempty"`
}
// UpdateIssueBoard update an issue board.
//
// GitLab API docs: https://docs.gitlab.com/ee/api/boards.html#create-a-board-starter
func
(
s
*
IssueBoardsService
)
UpdateIssueBoard
(
pid
interface
{},
board
int
,
opt
*
UpdateIssueBoardOptions
,
options
...
OptionFunc
)
(
*
IssueBoard
,
*
Response
,
error
)
{
project
,
err
:=
parseID
(
pid
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
u
:=
fmt
.
Sprintf
(
"projects/%s/boards/%d"
,
url
.
QueryEscape
(
project
),
board
)
req
,
err
:=
s
.
client
.
NewRequest
(
"PUT"
,
u
,
opt
,
options
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
is
:=
new
(
IssueBoard
)
resp
,
err
:=
s
.
client
.
Do
(
req
,
is
)
if
err
!=
nil
{
return
nil
,
resp
,
err
}
return
is
,
resp
,
err
}
// DeleteIssueBoard deletes an issue board.
//
// GitLab API docs: https://docs.gitlab.com/ee/api/boards.html#delete-a-board-starter
func
(
s
*
IssueBoardsService
)
DeleteIssueBoard
(
pid
interface
{},
board
int
,
options
...
OptionFunc
)
(
*
Response
,
error
)
{
project
,
err
:=
parseID
(
pid
)
if
err
!=
nil
{
return
nil
,
err
}
u
:=
fmt
.
Sprintf
(
"projects/%s/boards/%d"
,
url
.
QueryEscape
(
project
),
board
)
req
,
err
:=
s
.
client
.
NewRequest
(
"DELETE"
,
u
,
nil
,
options
)
if
err
!=
nil
{
return
nil
,
err
}
return
s
.
client
.
Do
(
req
,
nil
)
}
// ListIssueBoardsOptions represents the available ListIssueBoards() options.
//
// GitLab API docs: https://docs.gitlab.com/ce/api/boards.html#project-board
...
...
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