Documentation
¶
Overview ¶
package index provides methods for indexing SQLite databases using table constucts defined in the `aaronland/go-sqlite` package and records defined by the `whosonfirst/go-whosonfirst-iterate/v2` package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SQLiteIndexer ¶
type SQLiteIndexer struct {
// Timings is a boolean flag indicating whether timings (time to index records) should be recorded)
Timings bool
// Logger is a `log.Logger` instance
Logger *log.Logger
// contains filtered or unexported fields
}
SQLiteIndexer is a struct that provides methods for indexing records in one or more SQLite database tables
func NewSQLiteIndexer ¶
func NewSQLiteIndexer(opts *SQLiteIndexerOptions) (*SQLiteIndexer, error)
NewSQLiteInder returns a `SQLiteIndexer` configured with 'opts'.
func (*SQLiteIndexer) IndexPaths ¶
IndexPaths is deprecated and has been superseded by the `IndexURIs` method.
type SQLiteIndexerLoadRecordFunc ¶
type SQLiteIndexerLoadRecordFunc func(context.Context, string, io.ReadSeeker, ...interface{}) (interface{}, error)
SQLiteIndexerLoadRecordFunc is a custom `whosonfirst/go-whosonfirst-iterate/v2` callback function to be invoked for each record processed by the `IndexURIs` method.
type SQLiteIndexerOptions ¶
type SQLiteIndexerOptions struct {
// DB is the `aaronland/go-sqlite.Database` instance that records will be indexed in.
DB sqlite.Database
// Tables is the list of `aaronland/go-sqlite.Table` instances that records will be indexed in.
Tables []sqlite.Table
// LoadRecordFunc is a custom `whosonfirst/go-whosonfirst-iterate/v2` callback function to be invoked
// for each record processed by the `IndexURIs` method.
LoadRecordFunc SQLiteIndexerLoadRecordFunc
// PostIndexFunc is an optional custom function to invoke after a record has been indexed.
PostIndexFunc SQLiteIndexerPostIndexFunc
}
SQLiteIndexerOptions
type SQLiteIndexerPostIndexFunc ¶
type SQLiteIndexerPostIndexFunc func(context.Context, sqlite.Database, []sqlite.Table, interface{}) error
SQLiteIndexerPostIndexFunc is a custom function to invoke after a record has been indexed.