Skip to content

Commit 7feb154

Browse files
michaeldornerbradfitz
authored andcommitted
gerrit: add parameter for pagination in QueryChangesOpt
QueryChangesOpt has now a new pagination field Start for the number of first changes to skip, as it was already implemented for QueryAccountsOpt. Fixes golang/go#24838 Change-Id: If779a404f256aca1924ce2412c79b821f4f9f639 GitHub-Last-Rev: aa79a75 GitHub-Pull-Request: #8 Reviewed-on: https://go-review.googlesource.com/122584 Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent 5a0b491 commit 7feb154

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

gerrit/gerrit.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,12 @@ type QueryChangesOpt struct {
327327
// If 0, the 'n' parameter is not sent to Gerrit.
328328
N int
329329

330+
// Start is the number of results to skip (useful in pagination).
331+
// To figure out if there are more results, the last ChangeInfo struct
332+
// in the last call to QueryChanges will have the field MoreAccounts=true.
333+
// If 0, the 'S' parameter is not sent to Gerrit.
334+
Start int
335+
330336
// Fields are optional fields to also return.
331337
// Example strings include "ALL_REVISIONS", "LABELS", "MESSAGES".
332338
// For a complete list, see:
@@ -358,6 +364,7 @@ func (c *Client) QueryChanges(ctx context.Context, q string, opts ...QueryChange
358364
"q": {q},
359365
"n": condInt(opt.N),
360366
"o": opt.Fields,
367+
"S": condInt(opt.Start),
361368
})
362369
return changes, err
363370
}

0 commit comments

Comments
 (0)