Documentation ¶
Overview ¶
Package pagination provides primitives for implementing AIP pagination.
See: https://google.aip.dev/158 (Pagination).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodePageTokenStruct ¶ added in v0.22.0
DecodePageTokenStruct decodes an encoded page token into an arbitrary struct.
func EncodePageTokenStruct ¶ added in v0.22.0
func EncodePageTokenStruct(v interface{}) string
EncodePageTokenStruct encodes an arbitrary struct as a page token.
Types ¶
type PageToken ¶ added in v0.21.0
type PageToken struct { // Offset of the page. Offset int64 // RequestChecksum is the checksum of the request that generated the page token. RequestChecksum uint32 }
PageToken is a page token that uses an offset to delineate which page to fetch.
func ParsePageToken ¶ added in v0.21.0
ParsePageToken parses an offset-based page token from the provided Request.
If the request does not have a page token, a page token with offset 0 will be returned.
type Request ¶
type Request interface { proto.Message // GetPageToken returns the page token of the request. GetPageToken() string // GetPageSize returns the page size of the request. GetPageSize() int32 }
Request is an interface for paginated request messages.
See: https://google.aip.dev/158 (Pagination).
Click to show internal directories.
Click to hide internal directories.