Documentation ¶
Overview ¶
Package travel provides methods for iterating through one or more Who's On First records and "traveling" through the other records that it has a relationship with. These include parent records, records that supersede or are superseded by a WOF record or all the pointers in a records hierarchy.
Each step (or record) in a travel function is processed by a user-defined `TravelFunc`. This package includes a default callback function that simply prints some basic information about each record. More complex applications are outside the scope of this package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TravelFunc ¶
TravelFunc is a callback function to be invoked for each `geojson.Feature` encountered during a travel session.
func DefaultTravelFunc ¶
func DefaultTravelFunc() (TravelFunc, error)
DefaultTravelFunc returns a TravelFunc callback function that prints the current step, the feature's ID and name as well as its inception and cessation dates.
type TravelOptions ¶
type TravelOptions struct { // TravelFunc is a callback function to be invoked for each `geojson.Feature` encountered during a travel session. Callback TravelFunc // A `reader.Reader` instance used to load GeoJSON Feature data. Reader reader.Reader // A boolean flag to indicate whether to record timing information. Timings bool // A boolean flag to indcate whether or not the same record should be traveled more than once. If true then records will only be traveled once. Singleton bool // A boolean flag to indicate whether a travel session should include the records that a feature supersedes . Supersedes bool // A boolean flag to indicate whether a travel session should include the records that a feature is superseded by . SupersededBy bool // A boolean flag to indicate whether a travel session should include a feature's parent record. ParentID bool // A boolean flag to indicate whether a travel session should include the record in a feature's hierarchy. Hierarchy bool }
TravelOptions is a struct containing configuration details for a travel session.
func DefaultTravelOptions ¶
func DefaultTravelOptions() (*TravelOptions, error)
DefaultTravelOptions returns a TravelOptions struct configured as a singleton and to use the DefaultTravelFunc callback, a `null://` reader.
type Traveler ¶
type Traveler struct { // Options is a TravelOptions struct containing configuration details for the travel session. Options *TravelOptions Step int64 // contains filtered or unexported fields }
Traveler is a struct for walking the tree of supersedes or superseded_by relations for a Who's On First record.
func NewTraveler ¶
func NewTraveler(opts *TravelOptions) (*Traveler, error)
Create a new Traveler instance.
func (*Traveler) TravelFeature ¶
Travel the relationships for 'f' (a GeoJSON feature).
Directories ¶
Path | Synopsis |
---|---|
Package cmd provides command line tools for traveling iterating through one or more Who's On First records and "traveling" through the other records that it has a relationship with
|
Package cmd provides command line tools for traveling iterating through one or more Who's On First records and "traveling" through the other records that it has a relationship with |
Package traveller defines task-specific traveler methods.
|
Package traveller defines task-specific traveler methods. |