-
Notifications
You must be signed in to change notification settings - Fork 253
Open
Description
go-scm/scm/driver/stash/util.go
Lines 15 to 27 in f73f51e
func encodeListOptions(opts scm.ListOptions) string { | |
params := url.Values{} | |
if opts.Page > 1 { | |
params.Set("start", strconv.Itoa( | |
(opts.Page-1)*opts.Size), | |
) | |
} | |
if opts.Size != 0 { | |
params.Set("limit", strconv.Itoa(opts.Size)) | |
} | |
return params.Encode() | |
} | |
Reference to docs https://docs.atlassian.com/bitbucket-server/rest/5.16.0/bitbucket-rest.html
Important: If more than one page exists (i.e. the response contains "isLastPage": false), the response object will also contain a nextPageStart attribute which must be used by the client as the start parameter on the next request. Identifiers of adjacent objects in a page may not be contiguous, so the start of the next page is not necessarily the start of the last page plus the last page's size. A client should always use nextPageStart to avoid unexpected results from a paged API.
Metadata
Metadata
Assignees
Labels
No labels