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

Function Notes

bridge/gitlab/gitlab_api.go:46–77  ·  view source on GitHub ↗

Notes returns a channel with note events

(ctx context.Context, client *gitlab.Client, issue *gitlab.Issue)

Source from the content-addressed store, hash-verified

44
45// Notes returns a channel with note events
46func Notes(ctx context.Context, client *gitlab.Client, issue *gitlab.Issue) <-chan Event {
47 out := make(chan Event)
48
49 go func() {
50 defer close(out)
51
52 opts := gitlab.ListIssueNotesOptions{
53 OrderBy: gitlab.String("created_at"),
54 Sort: gitlab.String("asc"),
55 }
56
57 for {
58 notes, resp, err := client.Notes.ListIssueNotes(issue.ProjectID, issue.IID, &opts, gitlab.WithContext(ctx))
59
60 if err != nil {
61 out <- ErrorEvent{Err: err, Time: time.Now()}
62 }
63
64 for _, note := range notes {
65 out <- NoteEvent{*note}
66 }
67
68 if resp.CurrentPage >= resp.TotalPages {
69 break
70 }
71
72 opts.Page = resp.NextPage
73 }
74 }()
75
76 return out
77}
78
79// LabelEvents returns a channel with label events.
80func LabelEvents(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