-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.go
More file actions
53 lines (33 loc) · 936 Bytes
/
example.go
File metadata and controls
53 lines (33 loc) · 936 Bytes
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package main
import (
"log"
"github.com/cnam/gitlab-api-go/gitlabapi"
)
type Issue struct {
IssueId int `json:"id"`
ProjectId int `json:"project_id"`
Title string `json:"title"`
}
func main() {
var issues []Issue
var issue Issue
api := gitlabapi.NewApi("https://gitlab.com/api/v3", "qwerty")
p := make(map[string]string)
p["project_id"] = "83866"
command := api.NewCommand("GetIssuesByProject", p, &issues)
log.Printf("Request url %v", command.Request.URL)
command.Execute()
log.Printf("%+v", issues)
p["project_id"] = "83866"
p["issue_id"] = "144751"
command = api.NewCommand("GetIssue", p, &issue)
log.Printf("Request url %v", command.Request.URL)
command.Execute()
log.Printf("%+v", issue)
p["project_id"] = "83866"
p["title"] = "new issue"
command = api.NewCommand("CreateIssue", p, &issue)
log.Printf("Request url %v", command.Request.URL)
command.Execute()
log.Printf("%+v", issue)
}