pagination

package
v0.0.0-...-20ca37a Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: GPL-3.0 Imports: 6 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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

GetCursor 获取游标

func (*RawStore) LoadCursor

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

LoadCursor 加载游标

func (*RawStore) StoreCursor

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

StoreCursor 生成游标

func (*RawStore) StoreStringCursor

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

StoreCursor 生成游标

func (*RawStore) StoreTimeCursor

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

StoreCursor 生成游标

type Store

type Store interface {
	GetCursor() any
	LoadCursor(ctx context.Context, lastToken string, backward bool) error
	StoreCursor(_ context.Context, lastToken *string, first, last any) (*string, error)
	StoreStringCursor(_ context.Context, lastToken *string, first, last any) (*string, error)
	StoreTimeCursor(_ 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