From 80a5c864c57614104ce346da3eb7e57746930523 Mon Sep 17 00:00:00 2001 From: Nikita Tokarchuk Date: Sun, 6 Dec 2020 01:06:20 +0100 Subject: [PATCH] Fix comments --- mongox/database/streamloader.go | 4 +++- mongox/query/query.go | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/mongox/database/streamloader.go b/mongox/database/streamloader.go index 89b16f0..4aca640 100644 --- a/mongox/database/streamloader.go +++ b/mongox/database/streamloader.go @@ -71,11 +71,12 @@ func (l *StreamLoader) Next() (err error) { return } +// Cursor returns the underlying cursor func (l *StreamLoader) Cursor() (cursor *mongox.Cursor) { return l.cur } -// Close cursor +// Close stream loader and the underlying cursor func (l *StreamLoader) Close() (err error) { closerr := l.cur.Close(l.ctx) @@ -94,6 +95,7 @@ func (l *StreamLoader) Close() (err error) { return } +// Err returns the last error func (l *StreamLoader) Err() (err error) { return l.cur.Err() } diff --git a/mongox/query/query.go b/mongox/query/query.go index 7d658a1..be605da 100644 --- a/mongox/query/query.go +++ b/mongox/query/query.go @@ -119,6 +119,7 @@ func (q *Query) OnDecode() (callbacks Callbacks) { return q.ondecode } +// OnClose callback is called after the mongox ends a loading procedure func (q *Query) OnClose() (callbacks Callbacks) { return q.onclose }