MCPcopy Index your code
hub / github.com/git-bug/git-bug / Issues

Function Issues

bridge/gitlab/gitlab_api.go:12–43  ·  view source on GitHub ↗

Issues returns a channel with gitlab project issues, ascending order.

(ctx context.Context, client *gitlab.Client, pid string, since time.Time)

Source from the content-addressed store, hash-verified

10
11// Issues returns a channel with gitlab project issues, ascending order.
12func Issues(ctx context.Context, client *gitlab.Client, pid string, since time.Time) <-chan *gitlab.Issue {
13 out := make(chan *gitlab.Issue)
14
15 go func() {
16 defer close(out)
17
18 opts := gitlab.ListProjectIssuesOptions{
19 UpdatedAfter: &since,
20 Scope: gitlab.String("all"),
21 Sort: gitlab.String("asc"),
22 }
23
24 for {
25 issues, resp, err := client.Issues.ListProjectIssues(pid, &opts, gitlab.WithContext(ctx))
26 if err != nil {
27 return
28 }
29
30 for _, issue := range issues {
31 out <- issue
32 }
33
34 if resp.CurrentPage >= resp.TotalPages {
35 break
36 }
37
38 opts.Page = resp.NextPage
39 }
40 }()
41
42 return out
43}
44
45// Notes returns a channel with note events
46func Notes(ctx context.Context, client *gitlab.Client, issue *gitlab.Issue) <-chan Event {

Callers 1

ImportAllMethod · 0.85

Calls 2

closeFunction · 0.85
StringMethod · 0.65

Tested by

no test coverage detected