Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultPage defines the default page number DefaultPage = 1 // DefaultPageSize defines the default number of items per page // TODO: change to 15 when all clients are updated DefaultPageSize = 50 )
Variables ¶
This section is empty.
Functions ¶
func IsOffsetPaginationError ¶
IsOffsetPaginationError checks if the error is an OffsetPaginationError
Types ¶
type OffsetPaginationError ¶
type OffsetPaginationError struct {
// contains filtered or unexported fields
}
OffsetPaginationError is the error type for page-based pagination
func NewOffsetPaginationErrorStr ¶
func NewOffsetPaginationErrorStr(errMsg string) OffsetPaginationError
NewOffsetPaginationErrorStr creates a new OffsetPaginationError with the provided error message
func (OffsetPaginationError) Error ¶
func (e OffsetPaginationError) Error() string
Error returns the error message
func (OffsetPaginationError) Unwrap ¶
func (e OffsetPaginationError) Unwrap() error
Unwrap returns the wrapped error
type OffsetPaginationOpts ¶
type OffsetPaginationOpts struct {
// contains filtered or unexported fields
}
OffsetPaginationOpts is the options for page-based pagination
func NewDefaultOffsetPaginationOpts ¶
func NewDefaultOffsetPaginationOpts() *OffsetPaginationOpts
NewDefaultOffsetPaginationOpts creates a new OffsetPaginationOpts with default values
func NewOffsetPaginationOpts ¶
func NewOffsetPaginationOpts(offset, limit int) (*OffsetPaginationOpts, error)
NewOffsetPaginationOpts creates a new OffsetPaginationOpts with the provided page and pageSize
func (*OffsetPaginationOpts) Limit ¶
func (o *OffsetPaginationOpts) Limit() int
Limit returns the number of items per page
func (*OffsetPaginationOpts) Offset ¶
func (o *OffsetPaginationOpts) Offset() int
Offset returns the page number
Click to show internal directories.
Click to hide internal directories.