pkg

package
v0.0.0-...-91fc04f Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPage = 1
	DefaultSize = 50
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Pagination

type Pagination[T any] struct {
	Items []*T `json:"items"`
	Page  int  `json:"page"`
	Size  int  `json:"size"`
	Total int  `json:"total"`
}

func (*Pagination[T]) GetOffset

func (p *Pagination[T]) GetOffset() int

func (*Pagination[T]) GetPage

func (p *Pagination[T]) GetPage() int

func (*Pagination[T]) GetSize

func (p *Pagination[T]) GetSize() int

func (*Pagination[T]) Paginate

func (p *Pagination[T]) Paginate(items []*T, total int) *Pagination[T]

func (*Pagination[T]) Query

func (p *Pagination[T]) Query(db *gorm.DB) *gorm.DB

Jump to

Keyboard shortcuts

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