Documentation
¶
Overview ¶
Package pagination provides primitives for implementing AIP pagination.
See: https://google.aip.dev/158 (Pagination).
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Generator = NewTokenGenerator()
View Source
var InvalidTokenErr = status.Errorf( codes.InvalidArgument, "The field `page_token` is invalid.")
InvalidTokenErr is the error returned if the token provided is not parseable by the TokenGenerator.
Functions ¶
Types ¶
type TokenGenerator ¶
TokenGenerator generates a page token for a given index.
func NewTokenGenerator ¶
func NewTokenGenerator() TokenGenerator
NewTokenGenerator provides a new instance of a TokenGenerator.
func TokenGeneratorWithSalt ¶
func TokenGeneratorWithSalt(salt string) TokenGenerator
TokenGeneratorWithSalt provieds an instance of a TokenGenerator which uses the given salt.
Click to show internal directories.
Click to hide internal directories.