Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Paginate ¶
func Paginate(p *PaginateParams, pageToken string, totalSize int64) (offset int, limit int, nextPageToken string, err error)
Paginate the results by page_token, returns offset, limit and next_page_token.
func SetDefaultPageSize ¶
SetDefaultPageSize sets the default value of pageSize.
func SetMaxPageSize ¶
SetMaxPageSize sets the max limit to pageSize.
Types ¶
type IPaginateParams ¶
type IPaginateParams interface { GetParent() string GetPageSize() int32 GetPageToken() string GetOrderBy() string GetFilter() string }
IPaginateParams is an interface for paginate params.
type PaginateParams ¶
PaginateParams is the request params for pagination.
func Itop ¶
func Itop(i IPaginateParams) (p *PaginateParams)
Itop converts IPaginateParams to PaginateParams.
func NewPaginateParams ¶
func NewPaginateParams(page int, parent string, pageSize int, orderBy string, filter string) *PaginateParams
NewPaginateParams returns a PaginateParams pointer.
type PaginationError ¶ added in v0.2.0
PaginationError is an interface for pagination error.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.