Documentation
¶
Index ¶
Constants ¶
View Source
const EntrancesURL = "http://web.mta.info/developers/data/nyct/subway/StationEntrances.csv"
Variables ¶
View Source
var ( ErrAPIKeyRequired = fmt.Errorf("API key required") ErrAPIKeyNotAuthorized = fmt.Errorf("API key not authorized") ErrClientRequired = fmt.Errorf("client required") )
View Source
var ( SubwayFeeds []Feed = []Feed{ Feed123456S, FeedACEHS, FeedNQRW, FeedBDFM, FeedL, FeedSIR, FeedG, FeedJZ, Feed7, } BusFeeds []Feed = []Feed{ FeedBusTripUpdates, FeedBusVehiclePositions, FeedBusAlerts, } AllFeeds []Feed = append(SubwayFeeds, FeedLIRR, FeedMNR) AllAlerts []Feed = []Feed{ AlertsAll, AlertsSubway, AlertsBus, AlertsLIRR, AlertsMNR, } )
Functions ¶
This section is empty.
Types ¶
type Entrance ¶
type Entrance struct { Division string // Specifies which division the station belongs to; either BMT, IND or IRT. Example: "BMT" Line string StationName string // Name of the station as shown on subway handout map. Example: "14 St-Union Sq" StationLatitude float64 StationLongitude float64 Routes []string // Routes that serves the station (or complex, if applicable) during weekday service EntranceType EntranceType // Describes the physical entry way indicated by the coordinates and is usually one of the following: Door or Doorway, Stair, Escalator, Elevator, Ramp or Easement (which only specifies that the entrance is within other property and does not indicate if it is a stair, etc) Entry bool // Indicates whether this 'Entrance' has turnstiles that allow entry (as opposed to exit only - see below) ExitOnly bool // Indicates if this 'Entrance' is actually an exit only location and prohibits entry Vending bool Staffing Staffing // Indicates the current level of staffing that is available at this entrance; FULL indicates a booth agent is available 24/7, NONE means the area is not staffed, and PART indicates that an agent is on duty at certain times but not 24/7 StaffHours string ADA bool // If a station is ADA accessible value is TRUE; however note this does not indicate that the actual entrance is ADA accessible ADANotes string // Any special circumstances regarding ADA accessibility at this station (or complex, if applicable) FreeCrossover bool // If a passenger can switch route directions without exiting and paying another fare at this station (note this is station level information, not entrance level) NorthSouthStreet string // Primary vertical street adjacent to station entrance for wayfinding purposes EastWestStreet string // Primary horizontal street adjacent to station entrance for wayfinding purposes Corner string // Directional corner from the intersection of the vertical and horizontal streets Latitude float64 // Latitude degrees of the station entrance Longitude float64 // Longitude degrees of the station entrance }
func ParseEntrancesCSV ¶
type EntranceType ¶
type EntranceType int
const ( EntranceTypeUnknown EntranceType = iota EntranceTypeStair EntranceTypeEasement EntranceTypeDoor EntranceTypeElevator EntranceTypeEscalator EntranceTypeRamp EntranceTypeWalkway )
type Feed ¶
type Feed string
const ( Feed123456S Feed = "nyct/gtfs" // Red FeedACEHS Feed = "nyct/gtfs-ace" // Blue, Franklin Ave. Shuttle FeedNQRW Feed = "nyct/gtfs-nqrw" // Yellow FeedBDFM Feed = "nyct/gtfs-bdfm" // Orange FeedL Feed = "nyct/gtfs-l" FeedSIR Feed = "nyct/gtfs-si" // StatenIslandRailway FeedG Feed = "nyct/gtfs-g" FeedJZ Feed = "nyct/gtfs-jz" // Brown Feed7 Feed = "nyct/gtfs-7" FeedLIRR Feed = "lirr/gtfs-lirr" // Long Island Rail Road FeedMNR Feed = "mnr/gtfs-mnr" // Metro-North Railroad AlertsAll Feed = "camsys/all-alerts" // All Service Alerts AlertsSubway Feed = "camsys/subway-alerts" // Subway Alerts AlertsBus Feed = "camsys/bus-alerts" // Bus Alerts AlertsLIRR Feed = "camsys/lirr-alerts" // Long Island Rail Road Alerts AlertsMNR Feed = "camsys/mnr-alerts" // Metro-North Railroad Alerts FeedURL = "https://api-endpoint.mta.info/Dataservice/mtagtfsfeeds/" FeedBusTripUpdates Feed = "tripUpdates" FeedBusVehiclePositions Feed = "vehiclePositions" FeedBusAlerts Feed = "alerts" FeedURLBus = "http://gtfsrt.prod.obanyc.com/" )
type FeedsClient ¶
type FeedsClient struct {
// contains filtered or unexported fields
}
FeedsClient provides MTA GTFS-Realtime data Implements FeedsService interface.
func NewFeedsClient ¶
func NewFeedsClient(client HTTPClient, feedsApiKey, busApiKey, userAgent string) (*FeedsClient, error)
NewFeedsClient creates new FeedsClient
func (*FeedsClient) GetFeedMessage ¶
func (f *FeedsClient) GetFeedMessage(feedID Feed) (*gtfs.FeedMessage, error)
GetFeedMessage sends request to MTA server to get latest GTFS-Realtime data from specified feed
type FeedsService ¶
type FeedsService interface {
GetFeedMessage(feedID Feed) (*gtfs.FeedMessage, error)
}
Click to show internal directories.
Click to hide internal directories.