Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CursorMeta ¶
type CursorMeta struct {
Page CursorMetaPage `json:"page"`
}
CursorMeta Pagination metadata.
type CursorMetaPage ¶
type CursorMetaPage struct {
// First cursor
First *string `json:"first,omitempty"`
// Last cursor
Last *string `json:"last,omitempty"`
// Next URI to the next page
Next nullable.Nullable[string] `json:"next"`
// Previous URI to the previous page
Previous nullable.Nullable[string] `json:"previous"`
// Size of the requested page
Size int `json:"size"`
}
CursorMetaPage defines model for CursorMetaPage.
type CursorPaginationResponse ¶
type CursorPaginationResponse[T any] struct { // The data returned Data []T `json:"data"` Meta CursorMeta `json:"meta"` }
CursorPaginationResponse represents the response structure for cursor-based pagination
func NewCursorPaginationResponse ¶
func NewCursorPaginationResponse[T pagination.Item](items []T, pageSize int) CursorPaginationResponse[T]
NewCursorPaginationResponse creates a new pagination response from an ordered list of items. T must implement the Item interface for cursor generation.
type PageMeta ¶
type PageMeta struct {
Page PageMetaPage `json:"page"`
}
type PageMetaPage ¶
type PagePaginationResponse ¶
func NewPagePaginationResponse ¶
func NewPagePaginationResponse[T any](items []T, page PageMetaPage) PagePaginationResponse[T]
Click to show internal directories.
Click to hide internal directories.