paginate

package
v0.0.0-...-2448ec3 Latest Latest
Warning

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

Go to latest
Published: May 22, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPaginationParams

func GetPaginationParams(defaultLimit int, context echo.Context) (limit int, page int, offset int, err error)

Types

type Pagination

type Pagination struct {
	Limit        uint `json:"limit"`
	HasNextPage  bool `json:"has_next_page"`
	HasPrevPage  bool `json:"has_prev_page"`
	Page         uint `json:"page"`
	NextPage     uint `json:"next_page"`
	PrevPage     uint `json:"prev_page"`
	TotalPages   uint `json:"total_pages"`
	TotalMatches uint `json:"total_matches"`
}

func GetPaginationResults

func GetPaginationResults(table string, limit uint, page uint, db *gorm.DB) (Pagination, error)

take a *db as param with the where cause already applied

Jump to

Keyboard shortcuts

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