Help us shape the future of Go! Take the 2026 Go Developer Survey

gxpage

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2021 License: Apache-2.0 Imports: 0 Imported by: 34

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Page

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

Page is the default implementation of Page interface

func NewPage

func NewPage(requestOffset int, pageSize int,
	data []interface{}, totalSize int) *Page

NewPage will create an instance

func (*Page) GetData

func (d *Page) GetData() []interface{}

GetData will return the data

func (*Page) GetDataSize

func (d *Page) GetDataSize() int

GetDataSize will return the size of data. it's len(GetData())

func (*Page) GetOffset

func (d *Page) GetOffset() int

GetOffSet will return the offset

func (*Page) GetPageSize

func (d *Page) GetPageSize() int

GetPageSize will return the page size

func (*Page) GetTotalPages

func (d *Page) GetTotalPages() int

GetTotalPages will return the number of total pages

func (*Page) HasData

func (d *Page) HasData() bool

HasData will return whether this page has data.

func (*Page) HasNext

func (d *Page) HasNext() bool

HasNext will return whether has next page

type Pager

type Pager interface {

	// GetOffset will return the offset
	GetOffset() int

	// GetPageSize will return the page size
	GetPageSize() int

	// GetTotalPages will return the number of total pages
	GetTotalPages() int

	// GetData will return the data
	GetData() []interface{}

	// GetDataSize will return the size of data.
	// Usually it's len(GetData())
	GetDataSize() int

	// HasNext will return whether has next page
	HasNext() bool

	// HasData will return whether this page has data.
	HasData() bool
}

Pager is the abstraction for pagination usage.

Jump to

Keyboard shortcuts

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