index

package
v1.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2023 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Package index provides methods for cataloging and indexing directories containing Who's On First style property definition files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CatalogProperties

func CatalogProperties(ctx context.Context, opts *CatalogPropertiesOptions, paths ...string) error

CatalogProperties() will crawl one or more directories containing Who's On First style property definition files and cataloging each match in a `sync.Map` instance.

func EmitterCallbackFunc

func EmitterCallbackFunc(opts *EmitterCallbackFuncOptions) emitter.EmitterCallbackFunc

EmitterCallbackFunc() returns a custom `whosonfirst/go-whosonfirst-iterate/v2/emitter.EmitterCallbackFunc` callback function to be invoked when iterating through Who's On First data sources that will ensure there is a corresponding "properties" JSON file for each of the properties in every document that is encountered.

Types

type CatalogPropertiesOptions

type CatalogPropertiesOptions struct {
	// Lookup is a `sync.Map` instance whose keys are the names of properties that have already been encountered (crawl property definition files).
	Lookup *sync.Map
	// Logger is a `log.Logger` instance used to log state and feedback.
	Logger *log.Logger
}

CatalogPropertiesOptions is a struct containing configuration data for the `CatalogProperties` method.

type EmitterCallbackFuncOptions

type EmitterCallbackFuncOptions struct {
	// Debug is a boolean flag to signal that records should not be created or updated.
	Debug bool
	// Lookup is a `sync.Map` instance whose keys are the names of properties that have already been seen or processed.
	Lookup *sync.Map
	// Root is the root directory (path) where new and updated properties should be written.
	Root string
	// Mutex us a `sync.RWMutex` instance used prevent duplicate processing of the same properties.
	Mutex *sync.RWMutex
	// Exclude is an optional list of `sfomuseum/go-flags/multi.MultiRegexp` instances used to filter (exclude) certain properties.
	Exclude multi.MultiRegexp
	// Logger is a `log.Logger` instance used to log state and feedback.
	Logger *log.Logger
}

EmitterCallbackFuncOptions is a struct containing configuration options for the `EmitterCallbackFunc` method.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL