cursortoken

package
v0.0.546 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CTKeySort added in v0.0.538

type CTKeySort struct {
	Mode               Mode
	ValuePrimary       string
	ValueSecondary     string
	Direction          SortDirection
	DirectionSecondary SortDirection
	PageSize           int
	Extra              Extra
}

func (CTKeySort) IsEnd added in v0.0.539

func (c CTKeySort) IsEnd() bool

func (CTKeySort) Token added in v0.0.538

func (c CTKeySort) Token() string

type CTPaginated added in v0.0.538

type CTPaginated struct {
	Mode Mode
	Page int
}

func (CTPaginated) IsEnd added in v0.0.539

func (c CTPaginated) IsEnd() bool

func (CTPaginated) Token added in v0.0.538

func (c CTPaginated) Token() string

type CursorToken

type CursorToken interface {
	Token() string
	IsEnd() bool
}

func Decode

func Decode(tok string) (CursorToken, error)

func End

func End() CursorToken

func NewKeySortToken added in v0.0.538

func NewKeySortToken(valuePrimary string, valueSecondary string, direction SortDirection, directionSecondary SortDirection, pageSize int, extra Extra) CursorToken

func Page added in v0.0.538

func Page(p int) CursorToken

func PageEnd added in v0.0.538

func PageEnd() CursorToken

func Start

func Start() CursorToken

type Extra

type Extra struct {
	Timestamp *time.Time
	Id        *string
	Page      *int
	PageSize  *int
}

type Filter

type Filter interface {
	FilterQuery(ctx context.Context) mongo.Pipeline
	Pagination(ctx context.Context) (string, SortDirection, string, SortDirection)
}

type Mode

type Mode string
const (
	CTMStart  Mode = "START"
	CTMNormal Mode = "NORMAL"
	CTMEnd    Mode = "END"
)

type RawFilter added in v0.0.301

type RawFilter interface {
	FilterQuery(ctx context.Context) mongo.Pipeline
}

type SortDirection

type SortDirection string //@enum:type
const (
	SortASC  SortDirection = "ASC"
	SortDESC SortDirection = "DESC"
)

Jump to

Keyboard shortcuts

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