mongop

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: 6 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	IdCursorType = (*IdCursor)(nil)
)

Functions

This section is empty.

Types

type IdCursor

type IdCursor struct {
	ID string `json:"_id"`
}

func (*IdCursor) MakeSortOptions

func (s *IdCursor) MakeSortOptions(filter bson.M, backward bool) (bson.M, error)

type MongoCursor

type MongoCursor interface {
	MakeSortOptions(filter bson.M, backward bool) (bson.M, error)
}

type MongoPaginator

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

func NewMongoPaginator

func NewMongoPaginator(store pagination.Store, opts *pagination.PaginationOptions) *MongoPaginator

func (*MongoPaginator) MakeSortOptions

func (p *MongoPaginator) MakeSortOptions(ctx context.Context, filter bson.M) (bson.M, error)

MakeSortOptions 生成ID分页查询选项,并将filter在原地更新

func (*MongoPaginator) StoreCursor

func (p *MongoPaginator) StoreCursor(ctx context.Context, first, last any) error

Jump to

Keyboard shortcuts

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