pagination

package
v1.51.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2019 License: MIT Imports: 7 Imported by: 0

README

pagination

GoDoc

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

Install
import (
	"libs.altipla.consulting/pagination"
)
Contributing

You can make pull requests or create issues in GitHub. Any code you send should be formatted using make gofmt.

Running tests

Run the tests:

make test
License

MIT License

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 = 50

	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