Documentation ¶
Overview ¶
Package pagination implements handling of page sizes & tokens in CV APIs.
Index ¶
- func DecryptPageToken(ctx context.Context, pageToken string, dst proto.Message) error
- func EncryptPageToken(ctx context.Context, src proto.Message) (string, error)
- func InvalidPageSize(err error) error
- func InvalidToken(err error) error
- func ValidatePageSize(req requestWithPageSize, defaultValue, maxValue int32) (int32, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptPageToken ¶
DecryptPageToken extracts page token from the request into the given proto.
Returns appstatus-annotated InvalidArgument error if token isn't valid.
func EncryptPageToken ¶
EncryptPageToken encrypts a generic page token to an opaque URL-safe string,
Input proto can be nil, in which case resulting page token is empty.
func InvalidPageSize ¶
InvalidPageSize annotates the error with InvalidArgument appstatus.
func InvalidToken ¶
InvalidToken annotates the error with InvalidArgument appstatus.
func ValidatePageSize ¶
ValidatePageSize validates and caps page size from the given request.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.