view

package
v1.2.1-beta.4 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: Apache-2.0, MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultView

type DefaultView struct {
	Paginator paginator.Paginator
	Proximity int
}

DefaultView viewer interface implementation The paginator will look like the one from google

func (*DefaultView) Current

func (v *DefaultView) Current() (int, error)

Current returns current page number

func (*DefaultView) Last

func (v *DefaultView) Last() (int, error)

Last returns last page number

func (*DefaultView) Next

func (v *DefaultView) Next() (int, error)

Next returns next page number or zero if current page is the last page

func (*DefaultView) Pages

func (v *DefaultView) Pages() ([]int, error)

Pages returns the list of pages

func (*DefaultView) Prev

func (v *DefaultView) Prev() (int, error)

Prev returns previous page number or zero if current page is first page

type Viewer

type Viewer interface {
	Pages() ([]int, error)
	Next() (int, error)
	Prev() (int, error)
	Last() (int, error)
	Current() (int, error)
}

Viewer interface

func New

func New(p paginator.Paginator) Viewer

New DefaultView constructor

Jump to

Keyboard shortcuts

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