paginator

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2023 License: GPL-2.0 Imports: 8 Imported by: 0

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, sorter any, prefix string) *CacheStore

func (*CacheStore) GetSorter

func (s *CacheStore) GetSorter() any

func (*CacheStore) LoadSorter

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

func (*CacheStore) StoreSorter

func (s *CacheStore) StoreSorter(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(sorter any) *RawStore

func (*RawStore) GetSorter

func (s *RawStore) GetSorter() any

func (*RawStore) LoadSorter

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

func (*RawStore) StoreSorter

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

type Store

type Store interface {
	GetSorter() any
	LoadSorter(ctx context.Context, lastToken string, backward bool) error
	StoreSorter(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