page

package
v1.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeContinue added in v1.9.1

func DecodeContinue(ctx context.Context, resource, name, continueStr string) (int64, int64, error)

func EncodeContinue added in v1.9.1

func EncodeContinue(ctx context.Context, resource, name string, start, limit int64) (string, error)

func ParsePageParam

func ParsePageParam(r *restful.Request) (page int, size int)

ParsePageParam parses page and size from http request.

Types

type ContinueStruct added in v1.9.1

type ContinueStruct struct {
	ClsName  string `json:"clsName,omitempty"`
	Resource string `json:"resource,omitempty"`
	Name     string `json:"name,omitempty"`
	Start    int64  `json:"start,omitempty"`
	Limit    int64  `json:"limit,omitempty"`
}

type Pagination

type Pagination struct {
	Page       int         `json:"page"`
	PageSize   int         `json:"pageSize"`
	Total      int         `json:"total"`
	TotalPages int         `json:"totalPages"`
	Items      interface{} `json:"items"`
}

Pagination contains data for ping items

func Pagein

func Pagein(page int, size int, total int) (start int, end int, pagin Pagination)

Pagein returns start and end index by given param.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL