pagination

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_PAGE_SIZE = 50
	MAX_PAGE_SIZE     = 100

	GET_OPTION_KEY_PAGE      = "page"
	GET_OPTION_KEY_PAGE_SIZE = "page_size"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Pagination

type Pagination struct {
	Page     int   `json:"page"`
	NumPages int   `json:"numPages"`
	PageSize int   `json:"pageSize"`
	Count    int64 `json:"count"`
}

Pagination Exports

func NewPagination

func NewPagination(page, pageSize int, model *gorm.DB) *Pagination

NewPagination Exports

func PaginatorFromRequest

func PaginatorFromRequest(r *http.Request, model *gorm.DB) *Pagination

func (*Pagination) Paginate

func (p *Pagination) Paginate() func(db *gorm.DB) *gorm.DB

Paginate Exports

Jump to

Keyboard shortcuts

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