pagination

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Page      int    `query:"_page"`
	PerPage   int    `query:"_perPage"`
	SortDir   string `query:"_sortDir"`
	SortField string `query:"_sortField"`
}

func Parse

func Parse(c echo.Context) (*Data, error)
type Link struct {
	Name     string
	Active   bool
	Disabled bool
	Url      string
}
func Links(page, perPage int, cnt int64, qu url.Values) ([]Link, error)

Links generates links for cnt elements such that every page contains perPage elements, and we are on page

func LinksWithCountLimit

func LinksWithCountLimit(page, perPage int, cnt int64, qu url.Values, pageLimit int) ([]Link, error)

LinksWithCountLimit filters links generated by Links around page in a pageLimit range

Jump to

Keyboard shortcuts

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