Documentation
¶
Overview ¶
Package reader implements the `go-whosonfirst-iterate/emitter` interfaces using `whosonfirst/go-reader.Reader` instances.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewReaderIterator ¶
NewReaderIterator() returns a new `GitIterator` instance configured by 'uri' in the form of:
reader://?{PARAMETERS}
Where {PATH} is an optional path on disk where a repository will be clone to (default is to clone repository in memory) and {PARAMETERS} may be: * `?include=` Zero or more `aaronland/go-json-query` query strings containing rules that must match for a document to be considered for further processing. * `?exclude=` Zero or more `aaronland/go-json-query` query strings containing rules that if matched will prevent a document from being considered for further processing. * `?include_mode=` A valid `aaronland/go-json-query` query mode string for testing inclusion rules. * `?exclude_mode=` A valid `aaronland/go-json-query` query mode string for testing exclusion rules. * `?reader=` A valid `whosonfirst/go-reader` URI used to create the underlying reader instance.
Types ¶
type ReaderIterator ¶
type ReaderIterator struct {
iterate.Iterator
// contains filtered or unexported fields
}
GitIterator implements the `Iterator` interface for crawling records with a `whosonfirst/go-reader.Reader` instance.
func (*ReaderIterator) Close ¶
func (it *ReaderIterator) Close() error
Close performs any implementation specific tasks before terminating the iterator.
func (*ReaderIterator) IsIterating ¶
func (it *ReaderIterator) IsIterating() bool
IsIterating() returns a boolean value indicating whether 'it' is still processing documents.
func (*ReaderIterator) Iterate ¶
func (it *ReaderIterator) Iterate(ctx context.Context, uris ...string) iter.Seq2[*iterate.Record, error]
Iterate will return an `iter.Seq2[*Record, error]` for each record encountered in 'uris'.
func (*ReaderIterator) Seen ¶
func (it *ReaderIterator) Seen() int64
Seen() returns the total number of records processed so far.