Documentation ¶
Overview ¶
package galleries provides methods for working with boarding galleries at SFO.
Index ¶
- Constants
- func GeometryForGalleryIDs(ctx context.Context, r reader.Reader, gallery_ids ...int64) (orb.Geometry, error)
- func IsMultipleCandidates(e error) bool
- func IsNotFound(e error) bool
- func NewLookup(ctx context.Context, uri string) (architecture.Lookup, error)
- func NewLookupFromIterator(ctx context.Context, iterator_uri string, iterator_sources ...string) (architecture.Lookup, error)
- func NewLookupWithLookupFunc(ctx context.Context, lookup_func GalleriesLookupFunc) (architecture.Lookup, error)
- type GalleriesLookup
- type GalleriesLookupFunc
- type Gallery
- func CompileGalleriesData(ctx context.Context, iterator_uri string, iterator_sources ...string) ([]*Gallery, error)
- func FindAllGalleriesForDate(ctx context.Context, code string, date string) ([]*Gallery, error)
- func FindAllGalleriesForDateWithLookup(ctx context.Context, lookup architecture.Lookup, code string, date string) ([]*Gallery, error)
- func FindCurrentGallery(ctx context.Context, code string) (*Gallery, error)
- func FindCurrentGalleryWithLookup(ctx context.Context, lookup architecture.Lookup, code string) (*Gallery, error)
- func FindGalleriesCurrent(ctx context.Context, code string) ([]*Gallery, error)
- func FindGalleriesCurrentWithLookup(ctx context.Context, lookup architecture.Lookup, code string) ([]*Gallery, error)
- func FindGalleryForDate(ctx context.Context, code string, date string) (*Gallery, error)
- func FindGalleryForDateWithLookup(ctx context.Context, lookup architecture.Lookup, code string, date string) (*Gallery, error)
- type MultipleCandidates
- type NotFound
Constants ¶
const DATA_JSON string = "galleries.json"
Variables ¶
This section is empty.
Functions ¶
func GeometryForGalleryIDs ¶
func GeometryForGalleryIDs(ctx context.Context, r reader.Reader, gallery_ids ...int64) (orb.Geometry, error)
Derive a MultiPoint geoemtry for one or more gallery IDs.
func IsMultipleCandidates ¶ added in v0.0.11
func IsNotFound ¶ added in v0.0.11
func NewLookup ¶
NewLookup will return an `architecture.Lookup` instance. By default the lookup table is derived from precompiled (embedded) data in `data/galleries.json` by passing in `sfomuseum://` as the URI. It is also possible to create a new lookup table with the following URI options:
`sfomuseum://github`
This will cause the lookup table to be derived from the data stored at https://raw.githubusercontent.com/sfomuseum/go-sfomuseum-architecture/main/data/galleries.json. This might be desirable if there have been updates to the underlying data that are not reflected in the locally installed package's pre-compiled data.
`sfomuseum://iterator?uri={URI}&source={SOURCE}`
This will cause the lookup table to be derived, at runtime, from data emitted by a `whosonfirst/go-whosonfirst-iterate` instance. `{URI}` should be a valid `whosonfirst/go-whosonfirst-iterate/iterator` URI and `{SOURCE}` is one or more URIs for the iterator to process.
func NewLookupFromIterator ¶
func NewLookupWithLookupFunc ¶
func NewLookupWithLookupFunc(ctx context.Context, lookup_func GalleriesLookupFunc) (architecture.Lookup, error)
NewLookupWithLookupFunc will return an `architecture.Lookup` instance derived by data compiled using `lookup_func`.
Types ¶
type GalleriesLookup ¶
type GalleriesLookup struct {
architecture.Lookup
}
type GalleriesLookupFunc ¶
func NewLookupFuncWithGalleries ¶
func NewLookupFuncWithGalleries(ctx context.Context, galleries_list []*Gallery) GalleriesLookupFunc
NewLookup will return an `GalleriesLookupFunc` function instance that, when invoked, will populate an `architecture.Lookup` instance with data stored in `galleries_list`.
func NewLookupFuncWithReader ¶
func NewLookupFuncWithReader(ctx context.Context, r io.ReadCloser) GalleriesLookupFunc
NewLookup will return an `GalleriesLookupFunc` function instance that, when invoked, will populate an `architecture.Lookup` instance with data stored in `r`. `r` will be closed when the `GalleriesLookupFunc` 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`.
type Gallery ¶
type Gallery struct { // The Who's On First ID associated with this gallery. WhosOnFirstId int64 `json:"wof:id"` // The SFO Museum ID associated with this gallery. SFOMuseumId int64 `json:"sfomuseum:id"` // The map label (ID) associated with this gallery. MapId string `json:"map_id"` // The name of this gallery. Name string `json:"wof:name"` // The (EDTF) inception date for the gallery Inception string `json:"edtf:inception"` // The (EDTF) cessation date for the gallery Cessation string `json:"edtf:cessation"` // A Who's On First "existential" (`KnownUnknownFlag`) flag signaling the gallery's status IsCurrent int64 `json:"mz:is_current"` }
type Gallery is a struct representing a passenger gallery at SFO.
func CompileGalleriesData ¶
func CompileGalleriesData(ctx context.Context, iterator_uri string, iterator_sources ...string) ([]*Gallery, error)
CompileGalleriesData will generate a list of `Gallery` 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.
func FindAllGalleriesForDate ¶ added in v0.8.0
Return all the Galleries matching 'code' that were active for 'date'.
func FindAllGalleriesForDateWithLookup ¶ added in v0.8.0
func FindAllGalleriesForDateWithLookup(ctx context.Context, lookup architecture.Lookup, code string, date string) ([]*Gallery, error)
Return all the Gallerys matching 'code' that were active for 'date' using 'lookup'.
func FindCurrentGallery ¶ added in v0.0.11
Return the current Gallery matching 'code'. Multiple matches throw an error.
func FindCurrentGalleryWithLookup ¶ added in v0.0.11
func FindCurrentGalleryWithLookup(ctx context.Context, lookup architecture.Lookup, code string) (*Gallery, error)
Return the current Gallery matching 'code' with a custom architecture.Lookup instance. Multiple matches throw an error.
func FindGalleriesCurrent ¶ added in v0.0.11
Returns all Gallery instances matching 'code' that are marked as current.
func FindGalleriesCurrentWithLookup ¶ added in v0.0.11
func FindGalleriesCurrentWithLookup(ctx context.Context, lookup architecture.Lookup, code string) ([]*Gallery, error)
Returns all Gallery instances matching 'code' that are marked as current with a custom architecture.Lookup instance.
func FindGalleryForDate ¶ added in v0.8.0
Return the Gallery matching 'code' that was active for 'date'. Multiple matches throw an error.
type MultipleCandidates ¶ added in v0.0.11
type MultipleCandidates struct {
// contains filtered or unexported fields
}
func (MultipleCandidates) Error ¶ added in v0.0.11
func (e MultipleCandidates) Error() string
func (MultipleCandidates) String ¶ added in v0.0.11
func (e MultipleCandidates) String() string