page_token

package
v0.0.0-...-4241208 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type PageToken

type PageToken interface {
	TokenGenerator
	ProcessPageTokens
}

func NewTokenGenerate

func NewTokenGenerate(options ...TokenOption) PageToken

type ProcessPageTokens

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

type TokenGenerator

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

type TokenOption

type TokenOption func(*token)

func SetTokenMaxElements

func SetTokenMaxElements(elements int) TokenOption

SetTokenMaxElements .

func SetTokenMaxIndex

func SetTokenMaxIndex(index int32) TokenOption

SetTokenMaxIndex .

func SetTokenSalt

func SetTokenSalt(salt string) TokenOption

SetTokenSalt .

func SetTokenTimeLimitation

func SetTokenTimeLimitation(timeLimitation time.Duration) TokenOption

SetTokenTimeLimitation .

Jump to

Keyboard shortcuts

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