pagination

package
v0.0.0-...-9162fdb Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: GPL-2.0 Imports: 8 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheStore

type CacheStore struct {
	// contains filtered or unexported fields
}

func NewCacheStore

func NewCacheStore(c cache.Cache, cursor any, prefix string) *CacheStore

func (*CacheStore) GetCursor

func (s *CacheStore) GetCursor() any

func (*CacheStore) LoadCursor

func (s *CacheStore) LoadCursor(ctx context.Context, lastToken string, backward bool) error

func (*CacheStore) StoreCursor

func (s *CacheStore) StoreCursor(ctx context.Context, lastToken *string, first, last any) (*string, error)

type PaginationOptions

type PaginationOptions struct {
	Limit     *int64
	Offset    *int64
	Backward  *bool
	LastToken *string
}

func (*PaginationOptions) EnsureSafe

func (p *PaginationOptions) EnsureSafe()

type RawStore

type RawStore struct {
	// contains filtered or unexported fields
}

func NewRawStore

func NewRawStore(cursor any) *RawStore

func (*RawStore) GetCursor

func (s *RawStore) GetCursor() any

func (*RawStore) LoadCursor

func (s *RawStore) LoadCursor(_ context.Context, lastToken string, backward bool) error

func (*RawStore) StoreCursor

func (s *RawStore) StoreCursor(_ context.Context, lastToken *string, first, last any) (*string, error)

type Store

type Store interface {
	GetCursor() any
	LoadCursor(ctx context.Context, lastToken string, backward bool) error
	StoreCursor(ctx context.Context, lastToken *string, first, last any) (*string, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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