cursor

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package cursor provides access to cursor registry.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(params *NewParams) *cursor

New creates a new cursor.

Types

type NewParams

type NewParams struct {
	Iter       types.DocumentsIterator
	DB         string
	Collection string
	BatchSize  int32
}

NewParams contains the parameters for creating a new cursor.

type Registry

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

Registry stores cursors.

TODO add cleanup TODO add metrics

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates a new Registry.

func (*Registry) Cursor

func (r *Registry) Cursor(username string, id int64) *cursor

Cursor returns stored cursor by username and ID, or nil.

func (*Registry) DeleteCursor

func (r *Registry) DeleteCursor(username string, id int64)

DeleteCursor closes and deletes cursor.

func (*Registry) StoreCursor

func (r *Registry) StoreCursor(username string, c *cursor) int64

StoreCursor stores cursor and return its ID.

Jump to

Keyboard shortcuts

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