Documentation ¶
Index ¶
- func NewSFOMuseumLookup(ctx context.Context, uri string) (flights.FlightsLookup, error)
- func NewSFOMuseumLookupFromIterator(ctx context.Context, iterator_uri string, iterator_sources ...string) (flights.FlightsLookup, error)
- func NewSFOMuseumLookupWithLookupFunc(ctx context.Context, lookup_func FlightsLookupFunc) (flights.FlightsLookup, error)
- type Flight
- type FlightsLookup
- type FlightsLookupFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSFOMuseumLookup ¶ added in v0.0.9
func NewSFOMuseumLookupWithLookupFunc ¶
func NewSFOMuseumLookupWithLookupFunc(ctx context.Context, lookup_func FlightsLookupFunc) (flights.FlightsLookup, error)
NewSFOMuseumLookupWithLookupFunc will return an `flights.Lookup` instance derived by data compiled using `lookup_func`.
Types ¶
type Flight ¶
type Flight struct { WhosOnFirstId int64 `json:"wof:id"` SFOMuseumFlightId string `json:"sfomuseum:flight_id"` }
func CompileFlightsData ¶
func CompileFlightsData(ctx context.Context, iterator_uri string, iterator_sources ...string) ([]*Flight, error)
CompileFlightsData will generate a list of `Flight` struct to be used as the source data for an `SFOMuseumLookup` instance. The list of gate are compiled by iterating over one or more source. `iterator_uri` is a valid `whosonfirst/go-whosonfirst-iterate` URI and `iterator_sources` are one more (iterator) URIs to process.
type FlightsLookup ¶
type FlightsLookup struct {
flights.FlightsLookup
}
FlightsLookup provides an implementation of the `Lookup` interface for locating existing (WOF) flight records.
type FlightsLookupFunc ¶
func NewSFOMuseumLookupFuncWithFlights ¶
func NewSFOMuseumLookupFuncWithFlights(ctx context.Context, flights_list []*Flight) FlightsLookupFunc
func NewSFOMuseumLookupFuncWithReader ¶
func NewSFOMuseumLookupFuncWithReader(ctx context.Context, r io.ReadCloser) FlightsLookupFunc
NewSFOMuseumLookup will return an `FlightsLookupFunc` function instance that, when invoked, will populate an `architecture.Lookup` instance with data stored in `r`. `r` will be closed when the `FlightsLookupFunc` function instance is invoked. It is assumed that the data in `r` will be formatted in the same way as the procompiled (embedded) data stored in `data/sfomuseum.json`.