page

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConditionType

type ConditionType string
const (
	Equal    ConditionType = "="
	NotNull  ConditionType = "IS NOT NULL"
	IsNull   ConditionType = "IS NULL"
	Like     ConditionType = "LIKE"
	In       ConditionType = "IN"
	NotIn    ConditionType = "NOT IN"
	NotEqual ConditionType = "!="
)

type FilterCondition

type FilterCondition struct {
	Field string
	Type  ConditionType
	Value interface{}
}

type OrderType

type OrderType string
const (
	Asc  OrderType = "asc"
	Desc OrderType = "desc"
)

type Paginate

type Paginate[T any] struct {
	Total       int
	CurrentPage int
	PerPage     int
	TotalPages  int
	Models      []*T
}

func (Paginate[T]) GetCurrentPage

func (p Paginate[T]) GetCurrentPage() int

func (Paginate[T]) GetModels

func (p Paginate[T]) GetModels() any

func (Paginate[T]) GetPerPage

func (p Paginate[T]) GetPerPage() int

func (Paginate[T]) GetTotal

func (p Paginate[T]) GetTotal() int

func (Paginate[T]) GetTotalPages

func (p Paginate[T]) GetTotalPages() int

type PaginateInterface

type PaginateInterface interface {
	GetTotal() int
	GetCurrentPage() int
	GetPerPage() int
	GetTotalPages() int
	GetModels() any
}

type Pagination

type Pagination struct {
	Page    int
	PerPage int
}

type SortOrder

type SortOrder struct {
	Field string
	Order OrderType
}

Jump to

Keyboard shortcuts

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