You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As mentioned in #612 (comment), I wonder if it makes sense for the functions with auto-pagination to return a modified ResultInfo saying that "there's only one big single page" (that is, Page is 1, TotalPages is 1, and Count matches Total, etc,).
Use cases
It should be an invariant that Count always matches the number of returned entries, hiding the details of pagination when auto-pagination is enabled.
Potential cloudflare-go usage
rs, ri, err:=ListDNSRecords(ctx, ...)
// len(rs) == ri.Count should always hold whenever err == nil
References
This was discussed in #612. The discussion there was dismissed because we intended to enable auto-pagination unconditionally back then. However, the new API allows library users to turn off auto-pagination and thus the same design question re-appears.
The text was updated successfully, but these errors were encountered:
favonia
changed the title
Modify returned ResultInfo when auto-pagination is enabled
Modify returned ResultInfo when auto-pagination is enabled
Jan 4, 2023
favonia
changed the title
Modify returned ResultInfo when auto-pagination is enabled
Hide pagination info when auto-pagination is enabled
Jan 4, 2023
Current cloudflare-go version
0.54.0
Description
As mentioned in #612 (comment), I wonder if it makes sense for the functions with auto-pagination to return a modified
ResultInfo
saying that "there's only one big single page" (that is,Page
is1
,TotalPages
is1
, andCount
matchesTotal
, etc,).Use cases
It should be an invariant that
Count
always matches the number of returned entries, hiding the details of pagination when auto-pagination is enabled.Potential cloudflare-go usage
References
This was discussed in #612. The discussion there was dismissed because we intended to enable auto-pagination unconditionally back then. However, the new API allows library users to turn off auto-pagination and thus the same design question re-appears.
The text was updated successfully, but these errors were encountered: