paginator

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pagination

type Pagination struct {
	From         int         `json:"from"`
	To           int         `json:"to"`
	Total        int64       `json:"total"`
	Data         interface{} `json:"data"`
	PerPage      int         `json:"per_page"`
	CurrentPage  int         `json:"current_page"`
	Offset       int         `json:"-"`
	FirstPageUrl string      `json:"first_page_url"`
	PrevPage     *int        `json:"prev_page"`
	PrevPageUrl  *string     `json:"prev_page_url"`
	NextPage     *int        `json:"next_page"`
	NextPageUrl  *string     `json:"next_page_url"`
	LastPage     int         `json:"last_page"`
	LastPageUrl  string      `json:"last_page_url"`
	Path         string      `json:"path"`
}

func Paginate

func Paginate(p *Param, result interface{}) *Pagination

type Param

type Param struct {
	DB      *gorm.DB
	Req     *http.Request
	Page    int
	Limit   int
	OrderBy []string
	ShowSQL bool
}

Jump to

Keyboard shortcuts

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