pager

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BySize

func BySize(start int64, size int, cb Pager) error

func FromTo

func FromTo(start int64, to int64, size int, cb Pager) error

func ToMax

func ToMax(start int64, size int, cb Pager) error

Types

type Func

type Func func(from, to, limit int64) (int, error)

func (Func) Page

func (fn Func) Page(from, to, limit int64) (int, error)

type Pager

type Pager interface {
	// from and to are numbers in the ordered list that is paged
	// limit is how many can be read per page
	// the pager returns how many where read
	// returning a number less than the limit will
	// result in the pagination to stop
	Page(from, to, limit int64) (int, error)
}

Jump to

Keyboard shortcuts

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