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

Function StateEvents

bridge/gitlab/gitlab_api.go:113–140  ·  view source on GitHub ↗

StateEvents returns a channel with state change events.

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

Source from the content-addressed store, hash-verified

111
112// StateEvents returns a channel with state change events.
113func StateEvents(ctx context.Context, client *gitlab.Client, issue *gitlab.Issue) <-chan Event {
114 out := make(chan Event)
115
116 go func() {
117 defer close(out)
118
119 opts := gitlab.ListStateEventsOptions{}
120
121 for {
122 events, resp, err := client.ResourceStateEvents.ListIssueStateEvents(issue.ProjectID, issue.IID, &opts, gitlab.WithContext(ctx))
123 if err != nil {
124 out <- ErrorEvent{Err: err, Time: time.Now()}
125 }
126
127 for _, e := range events {
128 out <- StateEvent{*e}
129 }
130
131 if resp.CurrentPage >= resp.TotalPages {
132 break
133 }
134
135 opts.Page = resp.NextPage
136 }
137 }()
138
139 return out
140}

Callers 1

ImportAllMethod · 0.85

Calls 1

closeFunction · 0.85

Tested by

no test coverage detected