paginator

package module
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: MIT Imports: 3 Imported by: 0

README

GO-Paginator

Dependencies
  • gorm.io/gorm
  • git.verzth.work/go/jumper (For Demo Sources)

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        any   `json:"data"`
	PerPage     int   `json:"per_page"`
	CurrentPage int   `json:"current_page"`
	Offset      int   `json:"-"`
	PrevPage    *int  `json:"prev_page"`
	NextPage    *int  `json:"next_page"`
	LastPage    int   `json:"last_page"`
}

func Paginate

func Paginate[T any](p Param) Pagination

type Param

type Param struct {
	DB      *gorm.DB
	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