pagination

package
v1.64.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package pagination implements a pager that stores the state in a proto token and uses the altipla-consulting/database API.

Index

Constants

View Source
const (
	DefaultPageSize = 100
	MaxPageSize     = 1000

	Alphabet = "abcdefghijklmnopqrstuvwxyz1234567890"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Pager

type Pager struct {
	NextPageToken string
	TotalSize     int32
	PrevPageToken string
	// contains filtered or unexported fields
}

func NewPager

func NewPager(c *database.Collection) *Pager

func (*Pager) Fetch

func (pager *Pager) Fetch(ctx context.Context, models interface{}) error

func (*Pager) SetInputs

func (pager *Pager) SetInputs(pageToken string, pageSize int32)

Jump to

Keyboard shortcuts

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