Documentation
¶
Overview ¶
Package cursor provides access to DocumentDB cursors.
Index ¶
- type Registry
- func (r *Registry) Close(ctx context.Context)
- func (r *Registry) CloseCursor(ctx context.Context, id int64) bool
- func (r *Registry) Collect(ch chan<- prometheus.Metric)
- func (r *Registry) Describe(ch chan<- *prometheus.Desc)
- func (r *Registry) GetCursor(id int64) (wirebson.RawDocument, *pgx.Conn)
- func (r *Registry) NewCursor(ctx context.Context, id int64, continuation wirebson.RawDocument, ...)
- func (r *Registry) UpdateCursor(ctx context.Context, id int64, continuation wirebson.RawDocument)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry provides access to DocumentDB cursors.
func NewRegistry ¶
NewRegistry creates a new cursor registry.
func (*Registry) CloseCursor ¶
CloseCursor removes the cursor with the given id from the registry and closes it, if any. It returns true if the cursor was found and removed.
It attempts a clean close by sending the exit message to PostgreSQL. However, this could block so ctx is available to limit the time to wait (up to 3 seconds). The underlying connection will always be called regardless of any other errors.
func (*Registry) Collect ¶
func (r *Registry) Collect(ch chan<- prometheus.Metric)
Collect implements prometheus.Collector.
func (*Registry) Describe ¶
func (r *Registry) Describe(ch chan<- *prometheus.Desc)
Describe implements prometheus.Collector.
func (*Registry) GetCursor ¶
GetCursor returns the continuation and the connection for the given cursor id.
func (*Registry) NewCursor ¶
func (r *Registry) NewCursor(ctx context.Context, id int64, continuation wirebson.RawDocument, conn *pgx.Conn)
NewCursor stores a cursor with given continuation and connection (if any).
Passed context is used for logging/tracing, and for closing existing cursor, if any. See Registry.CloseCursor.
func (*Registry) UpdateCursor ¶
UpdateCursor updates existing cursor with given continuation, or closes it if continuation is empty.
Passed context is used for logging/tracing, and for closing the cursor (see Registry.CloseCursor).