Documentation ¶
Index ¶
- type IAdapter
- type IPaginator
- type Options
- type Paginator
- func (p Paginator) Clear()
- func (p *Paginator) Get(dest any) error
- func (p *Paginator) GetCurrentPage() int64
- func (p *Paginator) GetDestItems(dest any) any
- func (p *Paginator) GetLastPage() (int64, error)
- func (p *Paginator) GetListRows() int64
- func (p *Paginator) GetResult(dest any) *Result
- func (p *Paginator) GetTotal() (int64, error)
- func (p *Paginator) HasPages() bool
- func (p *Paginator) SetCurrentPage(currentPage int64)
- func (p *Paginator) SetDestItems(dest any)
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IPaginator ¶
type IPaginator interface { Clear() // Get 获取数据 Get(dest any) error // SetDestItems 设置输出源 SetDestItems(dest any) // GetDestItems 获取输出源 GetDestItems(dest any) any // GetResult 获取 Result结构体数据 GetResult(dest any) *Result // SetCurrentPage 设置当前页数 SetCurrentPage(currentPage int64) // GetCurrentPage 获取当前页页码 GetCurrentPage() int64 // GetTotal 获取数据总条数 GetTotal() (int64, error) // GetListRows 获取每页数量 GetListRows() int64 //GetLastPage 获取最后一页页码 GetLastPage() (int64, error) //HasPages 数据是否足够分页 HasPages() bool }
func SimplePaginator ¶
func SimplePaginator(adapter IAdapter, listRows, currentPage int64) IPaginator
func TotalPaginator ¶
func TotalPaginator(adapter IAdapter, listRows, currentPage, total int64) IPaginator
type Options ¶
func DefaultOptions ¶
func DefaultOptions() Options
type Paginator ¶
type Paginator struct { Simple bool //数据集适配器 IAdapter IAdapter //设置输出源 DestItems any //当前页 CurrentPage int64 //最后一页 LastPage int64 //数据总数 Total int64 //每页数量 ListRows int64 //是否有下一页 HasMore bool //分页配置 Options Options }
func (*Paginator) GetCurrentPage ¶
GetCurrentPage 获取当前页页码
func (*Paginator) GetDestItems ¶
func (*Paginator) GetLastPage ¶
GetLastPage 获取最后一页页码
func (*Paginator) SetCurrentPage ¶
SetCurrentPage 设置当前页数
func (*Paginator) SetDestItems ¶
Click to show internal directories.
Click to hide internal directories.