pagination

package
v0.0.0-...-05b3b51 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Paginator

type Paginator struct {
	TotalRecords int         `json:"total_records"`
	TotalPages   int         `json:"total_pages"`
	Records      interface{} `json:"records"`
	Offset       int         `json:"offset"`
	PerPage      int         `json:"per_page"`
	CurrentPage  int         `json:"cur_page"`
	PrevPage     int         `json:"prev_page"`
	NextPage     int         `json:"next_page"`
}

func Paginate

func Paginate(p *Query, dest interface{}, scan bool) *Paginator

*Paginate given query and destination of model array returns paginator

type Query

type Query struct {
	DB          *gorm.DB
	CurrentPage int
	PerPage     int
	OrderBy     []string
}

Jump to

Keyboard shortcuts

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