[chore] Make paging logic more generic (#901)

* make paging logic more generic
not just for timelines!

* linty linterson
This commit is contained in:
tobi
2022-10-10 15:52:49 +02:00
committed by GitHub
parent 80663061d8
commit 832befd727
9 changed files with 257 additions and 200 deletions

View File

@ -18,12 +18,10 @@
package model
import "github.com/superseriousbusiness/gotosocial/internal/timeline"
// TimelineResponse wraps a slice of timelineables, ready to be serialized, along with the Link
// header for the previous and next queries, to be returned to the client.
type TimelineResponse struct {
Items []timeline.Timelineable
// PageableResponse wraps a slice of items, ready to be serialized, along with the Link
// header for the previous and next queries / pages, to be returned to the client.
type PageableResponse struct {
Items []interface{}
LinkHeader string
NextLink string
PrevLink string