sourcegraph / go-sourcegraph

https://sourcegraph.com/github.com/sourcegraph/go-sourcegraph
MIT License
42 stars 9 forks source link

Split ListResponse into two separate pagination structs #72

Closed renfredxh closed 9 years ago

renfredxh commented 9 years ago

We discovered while working on search we discovered there are two types of paginated responses. One is when you know the total number of results ahead of time, and the other is when you don't. Prior to this change the ListResponse had two fields, one for each of these cases.

We realized it doesn't make sense to cover both situations in one struct so now this has been split into ListResponse for responses return a total number of results, and a StreamResponse, for responses with a currently unknown or unbounded total.

I have already tested the impact of this change on the Sourcegraph repo locally and once everything was converted to the right type of struct it worked well.

@shurcooL

dmitshur commented 9 years ago

This change makes a lot of sense.

Left one comment about documentation.

Otherwise everything LGTM.