pagination

package
v0.0.0-...-7bf56e6 Latest Latest
Warning

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

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

Documentation

Overview

Package pagination implements handling of page sizes & tokens in CV APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptPageToken

func DecryptPageToken(ctx context.Context, pageToken string, dst proto.Message) error

DecryptPageToken extracts page token from the request into the given proto.

Returns appstatus-annotated InvalidArgument error if token isn't valid.

func EncryptPageToken

func EncryptPageToken(ctx context.Context, src proto.Message) (string, error)

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

func InvalidPageSize(err error) error

InvalidPageSize annotates the error with InvalidArgument appstatus.

func InvalidToken

func InvalidToken(err error) error

InvalidToken annotates the error with InvalidArgument appstatus.

func ValidatePageSize

func ValidatePageSize(req requestWithPageSize, defaultValue, maxValue int32) (int32, error)

ValidatePageSize validates and caps page size from the given request.

Types

This section is empty.

Jump to

Keyboard shortcuts

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