countable

package
Version: v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const COUNTABLE string = "*"
View Source
const PAGE int64 = 1
View Source
const PER_PAGE int64 = 10
View Source
const SPILL int64 = 2

Variables

This section is empty.

Functions

func NewCountablePaginationOptions

func NewCountablePaginationOptions() (pagination.PaginationOptions, error)

func NewPaginationFromCount

func NewPaginationFromCount(total_count int64) (pagination.Pagination, error)

func NewPaginationFromCountWithOptions

func NewPaginationFromCountWithOptions(opts pagination.PaginationOptions, total_count int64) (pagination.Pagination, error)

Types

type CountablePagination

type CountablePagination struct {
	pagination.Pagination `json:",omitempty"`
	TotalCount            int64   `json:"total"`
	PerPageCount          int64   `json:"per_page"`
	PageCount             int64   `json:"page"`
	PagesCount            int64   `json:"pages"`
	NextPageURI           int64   `json:"next_page"`
	PreviousPageURI       int64   `json:"previous_page"`
	PagesRange            []int64 `json:"pages_range"`
}

func (*CountablePagination) NextPage

func (p *CountablePagination) NextPage() int64

func (*CountablePagination) NextURL

func (p *CountablePagination) NextURL(u *url.URL) string

func (*CountablePagination) Page

func (p *CountablePagination) Page() int64

func (*CountablePagination) Pages

func (p *CountablePagination) Pages() int64

func (*CountablePagination) PerPage

func (p *CountablePagination) PerPage() int64

func (*CountablePagination) PreviousPage

func (p *CountablePagination) PreviousPage() int64

func (*CountablePagination) PreviousURL

func (p *CountablePagination) PreviousURL(u *url.URL) string

func (*CountablePagination) Range

func (p *CountablePagination) Range() []int64

func (*CountablePagination) Total

func (p *CountablePagination) Total() int64

type CountablePaginationOptions

type CountablePaginationOptions struct {
	pagination.PaginationOptions
	// contains filtered or unexported fields
}

func (*CountablePaginationOptions) Column

func (opts *CountablePaginationOptions) Column(args ...string) string

func (*CountablePaginationOptions) Page

func (opts *CountablePaginationOptions) Page(args ...int64) int64

func (*CountablePaginationOptions) PerPage

func (opts *CountablePaginationOptions) PerPage(args ...int64) int64

func (*CountablePaginationOptions) Spill

func (opts *CountablePaginationOptions) Spill(args ...int64) int64

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL