pagination

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager handles the pagination.

func New

func New(limit uint, count int, currentTable string) (*Manager, error)

New returns a pointer to a Manager instance.

func (*Manager) CurrentPage

func (m *Manager) CurrentPage() int

CurrentPage returns the currentPage value.

func (*Manager) CurrentTable

func (m *Manager) CurrentTable() string

CurrentTable sets the current table name.

func (*Manager) Limit

func (m *Manager) Limit() uint

Limit returns the limit.

func (*Manager) NextPage

func (m *Manager) NextPage() error

NextPage increases the value currentPage.

func (*Manager) Offset

func (m *Manager) Offset() int

Offset returns the limit.

func (*Manager) PreviousPage

func (m *Manager) PreviousPage() error

PreviousPage decreases the value of currentPage.

func (*Manager) SetCurrentTable

func (m *Manager) SetCurrentTable(tableName string)

SetCurrentTable sets the current table name.

func (*Manager) TotalPages

func (m *Manager) TotalPages() int

TotalPages returns the total pages count.

Jump to

Keyboard shortcuts

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