sfomuseum

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSFOMuseumLookup added in v0.0.9

func NewSFOMuseumLookup(ctx context.Context, uri string) (flights.FlightsLookup, error)

func NewSFOMuseumLookupFromIterator

func NewSFOMuseumLookupFromIterator(ctx context.Context, iterator_uri string, iterator_sources ...string) (flights.FlightsLookup, error)

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.

func (*FlightsLookup) Append

func (l *FlightsLookup) Append(ctx context.Context, data interface{}) error

func (*FlightsLookup) Find

func (l *FlightsLookup) Find(ctx context.Context, code string) ([]interface{}, error)

type FlightsLookupFunc

type FlightsLookupFunc func(context.Context)

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`.

Jump to

Keyboard shortcuts

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