Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultPageSize default pagination page size. DefaultPageSize = int32(100) // MinPageSize minimum pagination page size. MinPageSize = int32(1) // MaxPageSize maximum pagination page size. MaxPageSize = int32(100) // ServerSetPageSize . ServerSetPageSize = int32(0) // SingleResultSet (INTERNAL USE ONLY). SingleResultSet = int32(-1) // TotalsOnlyResultSet . TotalsOnlyResultSet = int32(-2) )
Variables ¶
This section is empty.
Functions ¶
func IsCountOnly ¶
func IsCountOnly(p *dsc2.PaginationRequest) bool
Types ¶
type Cursor ¶
func DecodeCursor ¶
type KeyComparer ¶
type Result ¶
type Result[T any] struct { Items []T PageInfo *dsc2.PaginationResponse }
func PaginateSlice ¶
func PaginateSlice[T any]( s []T, page *dsc2.PaginationRequest, keyCount int, cmp KeyComparer[T], mapper KeyMapper[T], ) (*Result[T], error)
Click to show internal directories.
Click to hide internal directories.