page_token

package
v0.0.0-...-d3f65ed Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidToken         = errors.New("the field `page_token` is invalid")
	ErrOverdueToken         = errors.New("the field `page_token` is overdue")
	ErrOverMaxPageSizeToken = errors.New("the field `page_token` is over max page size")
	ErrInvalidPageSize      = errors.New("the page size provided must not be negative")
)

Functions

func SetMaxElements

func SetMaxElements(max int) options.Option

func SetMaxIndex

func SetMaxIndex(max int) options.Option

func SetSalt

func SetSalt(salt string) options.Option

func SetTimeLimitation

func SetTimeLimitation(d time.Duration) options.Option

Types

type PageToken

type PageToken interface {
	TokenGenerator
	ProcessPageTokens
}

func NewTokenGenerate

func NewTokenGenerate(resourceIdentification string, options ...options.Option) PageToken

type ProcessPageTokens

type ProcessPageTokens interface {
	ProcessPageTokens(numElements int, pageSize int, pageToken string) (start, end int, nextToken string, err error)
}

type TokenGenerator

type TokenGenerator interface {
	ForIndex(int) string
	GetIndex(string) (int, error)
}

Jump to

Keyboard shortcuts

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