Documentation ¶
Index ¶
Constants ¶
View Source
const ( BusProdURL = "https://pcsdata.njtransit.com/api/GTFS/" BusTestURL = "https://testpcsdata.njtransit.com/api/GTFS/" )
View Source
const ( BusDVProdURL = "https://pcsdata.njtransit.com/api/BUSDV2/" BusDVTestURL = "https://testpcsdata.njtransit.com/api/BUSDV2/" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BusClient ¶
type BusClient struct {
// contains filtered or unexported fields
}
BusClient holds information between API calls
func NewBusClient ¶
func NewBusClient( url, username, password, userAgent string, client HTTPClient, ) (*BusClient, error)
NewBusClient creates new BusClient
func (*BusClient) AuthenticateUser ¶
AuthenticateUser gets token for user
func (*BusClient) GetTripUpdates ¶
func (bc *BusClient) GetTripUpdates() (*gtfs.FeedMessage, error)
func (*BusClient) GetVehiclePositions ¶
func (bc *BusClient) GetVehiclePositions() (*gtfs.FeedMessage, error)
type BusDV2Client ¶
type BusDV2Client struct {
// contains filtered or unexported fields
}
BusDV2Client holds information between API calls
func NewBusDV2Client ¶
func NewBusDV2Client( url, username, password, userAgent string, client HTTPClient, ) (*BusDV2Client, error)
NewBusDV2Client creates new BusDV2Client
func (*BusDV2Client) AuthenticateUser ¶
func (bc *BusDV2Client) AuthenticateUser() error
AuthenticateUser gets token for user
func (*BusDV2Client) GetBusDV ¶
func (bc *BusDV2Client) GetBusDV(stop, direction, route, ip string) (*GetBusDVResponse, error)
func (*BusDV2Client) GetVehicleLocations ¶
func (bc *BusDV2Client) GetVehicleLocations(lat, lon string, radius int, mode string) (*GetVehicleLocations, error)
type DVTrip ¶
type DVTrip struct { PublicRoute string `json:"public_route"` Header string `json:"header"` Lanegate string `json:"lanegate"` DepartureTime string `json:"departuretime"` Remarks string `json:"remarks"` InternalTripNum string `json:"internal_trip_number"` SchedDepTime string `json:"sched_dep_time"` TimingPointID string `json:"timing_point_id"` Message string `json:"message"` FullScreen string `json:"fullscreen"` PassLoad string `json:"passload"` VehicleID string `json:"vehicle_id"` }
type GetBusDVResponse ¶
type GetVehicleLocations ¶
type GetVehicleLocations []VehicleLocation
type VehicleLocation ¶
type VehicleLocation struct { VehicleLat string `json:"VehicleLat"` VehicleLong string `json:"VehicleLong"` VehicleID string `json:"VehicleID"` VehiclePassengerLoad string `json:"VehiclePassengerLoad"` VehicleRoute string `json:"VehicleRoute"` VehicleDestination string `json:"VehicleDestination"` VehicleDistanceMiles string `json:"VehicleDistanceMiles"` VehicleInternalTripNumber string `json:"VehicleInternalTripNumber"` VehicleScheduledDeparture string `json:"VehicleScheduledDeparture"` }
Click to show internal directories.
Click to hide internal directories.