forked from profclems/glab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboard.go
39 lines (32 loc) · 1.02 KB
/
board.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package api
import "github.com/xanzy/go-gitlab"
var CreateIssueBoard = func(client *gitlab.Client, projectID interface{}, opts *gitlab.CreateIssueBoardOptions) (*gitlab.IssueBoard, error) {
if client == nil {
client = apiClient.Lab()
}
board, _, err := client.Boards.CreateIssueBoard(projectID, opts)
if err != nil {
return nil, err
}
return board, nil
}
var ListIssueBoards = func(client *gitlab.Client, projectID interface{}, opts *gitlab.ListIssueBoardsOptions) ([]*gitlab.IssueBoard, error) {
if client == nil {
client = apiClient.Lab()
}
boards, _, err := client.Boards.ListIssueBoards(projectID, opts)
if err != nil {
return nil, err
}
return boards, nil
}
var GetIssueBoardLists = func(client *gitlab.Client, projectID interface{}, boardID int, opts *gitlab.GetIssueBoardListsOptions) ([]*gitlab.BoardList, error) {
if client == nil {
client = apiClient.Lab()
}
boardLists, _, err := client.Boards.GetIssueBoardLists(projectID, boardID, opts)
if err != nil {
return nil, err
}
return boardLists, nil
}