Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IndexRelationsFuncOptions ¶
type IndexRelationsFuncOptions struct {
// Reader is a valid `whosonfirst/go-reader` instance used to load Who's On First feature data
Reader reader.Reader
// Strict is a boolean flag indicating whether the failure to load or parse feature record should trigger a critical error.
Strict bool
}
IndexRelationsFuncOptions
type Indexer ¶
type Indexer struct {
// contains filtered or unexported fields
}
Indexer is a struct that provides methods for indexing records in one or more SQLite database_sql.tables
func NewIndexer ¶
func NewIndexer(opts *IndexerOptions) (*Indexer, error)
NewSQLiteInder returns a `Indexer` configured with 'opts'.
func (*Indexer) IndexIteratorRecord ¶ added in v0.0.9
IndexIterateRecord will index 'rec' in the underlying database.
type IndexerLoadRecordFunc ¶
type IndexerLoadRecordFunc func(context.Context, string, io.ReadSeeker, ...interface{}) (interface{}, error)
IndexerLoadRecordFunc is a custom function to be invoked for each record processed by the `IndexURIs` method.
func LoadRecordFunc ¶
func LoadRecordFunc(opts *LoadRecordFuncOptions) IndexerLoadRecordFunc
LoadRecordFunc returns a `go-whosonfirst-sql/indexer/IndexerLoadRecordFunc` callback function that will ensure the the record being processed is a valid Who's On First GeoJSON Feature record.
type IndexerOptions ¶
type IndexerOptions struct {
// DB is the `database_sql.sql.DB` instance that records will be indexed in.
DB *sql.DB
// Tables is the list of `sfomuseum/go-database_sql.Table` instances that records will be indexed in.
Tables []database_sql.Table
// LoadRecordFunc is a custom `whosonfirst/go-whosonfirst-iterate/v2` callback function to be invoked
// for each record processed by the `IndexURIs` method.
LoadRecordFunc IndexerLoadRecordFunc
// PostIndexFunc is an optional custom function to invoke after a record has been indexed.
PostIndexFunc IndexerPostIndexFunc
// The maxiumum number of Go routines (workers) to use when indexing records.
Workers int
}
IndexerOptions
type IndexerPostIndexFunc ¶
IndexerPostIndexFunc is a custom function to invoke after a record has been indexed.
func IndexRelationsFunc ¶
func IndexRelationsFunc(r reader.Reader) IndexerPostIndexFunc
IndexRelationsFunc returns a `go-whosonfirst-sql/indexer/IndexerPostIndexFunc` callback function used to index relations for a WOF record after that record has been successfully indexed.
func IndexRelationsFuncWithOptions ¶
func IndexRelationsFuncWithOptions(opts *IndexRelationsFuncOptions) IndexerPostIndexFunc
IndexRelationsFuncWithOptions returns a `go-whosonfirst-sql/indexer/IndexerPostIndexFunc` callback function used to index relations for a WOF record after that record has been successfully indexed, but with custom `IndexRelationsFuncOptions` options defined in 'opts'.
type LoadRecordFuncOptions ¶
type LoadRecordFuncOptions struct {
// StrictAltFiles is a boolean flag indicating whether the failure to load or parse an alternate geometry file should trigger a critical error.
StrictAltFiles bool
}
LoadRecordFuncOptions is a struct to define options when loading Who's On First feature records.