cursortoken

package
v0.0.439 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CursorToken

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

func Decode

func Decode(tok string) (CursorToken, error)

func End

func End() CursorToken

func Start

func Start() CursorToken

func (*CursorToken) Token

func (c *CursorToken) Token() string

func (*CursorToken) ValuePrimaryObjectId

func (c *CursorToken) ValuePrimaryObjectId() (primitive.ObjectID, bool)

func (*CursorToken) ValueSecondaryObjectId

func (c *CursorToken) ValueSecondaryObjectId() (primitive.ObjectID, bool)

type Extra

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

type Filter

type Filter interface {
	FilterQuery() mongo.Pipeline
	Pagination() (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() 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