nextbus

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgencyListResponse

type AgencyListResponse struct {
	Response
	Agencies []AgencyListResponse_Agency `xml:"agency"`
}

type AgencyListResponse_Agency

type AgencyListResponse_Agency struct {
	Tag         string `xml:"tag,attr"`
	Title       string `xml:"title,attr"`
	RegionTitle string `xml:"regionTitle,attr"`
}

type Client

type Client struct {
	URL string
	// contains filtered or unexported fields
}

func NewClient

func NewClient() (*Client, error)

func (*Client) AgencyList

func (c *Client) AgencyList() (*AgencyListResponse, error)

func (*Client) Messages

func (c *Client) Messages(agency string, routeTags ...string) (*MessagesResponse, error)

func (*Client) PredictionsForStopId

func (c *Client) PredictionsForStopId(agency, stopId string) (*PredictionsResponse, error)

func (*Client) PredictionsForStopTag

func (c *Client) PredictionsForStopTag(agency, routeTag, stopTag string) (*PredictionsResponse, error)

func (*Client) RouteConfig

func (c *Client) RouteConfig(agency, routeTag string) (*RouteConfigResponse, error)

func (*Client) RouteList

func (c *Client) RouteList(agency string) (*RouteListResponse, error)

func (*Client) Schedule

func (c *Client) Schedule(agency, routeTag string) (*ScheduleResponse, error)

func (*Client) VehicleLocations

func (c *Client) VehicleLocations(agency, routeTag string, lastUpdatedMs uint64) (*VehicleLocationsResponse, error)

type MessagesResponse

type MessagesResponse struct {
	// TODO: not implemented
	Response
}

type PredictionsResponse

type PredictionsResponse struct {
	Response
	Prediction PredictionsResponse_Predictions `xml:"predictions"`
}

type PredictionsResponse_Direction

type PredictionsResponse_Direction struct {
	Title       string                           `xml:"title,attr"`
	Predictions []PredictionsResponse_Prediction `xml:"prediction"`
}

type PredictionsResponse_Message

type PredictionsResponse_Message struct {
	Text     string `xml:"text,attr"`
	Priority string `xml:"priority,attr"`
}

type PredictionsResponse_Prediction

type PredictionsResponse_Prediction struct {
	EpochTime         uint64 `xml:"epochTime,attr"`
	Seconds           uint32 `xml:"seconds,attr"`
	Minutes           uint32 `xml:"minutes,attr"`
	IsDeparture       bool   `xml:"isDeparture,attr"`
	DirTag            string `xml:"dirTag,attr"`
	Vehicle           string `xml:"vehicle,attr"`
	VehiclesInConsist uint32 `xml:"vehiclesInConsist,attr"`
	Block             string `xml:"block,attr"`
	TripTag           string `xml:"tripTag,attr"`
}

type PredictionsResponse_Predictions

type PredictionsResponse_Predictions struct {
	AgencyTitle string                          `xml:"agencyTitle,attr"`
	RouteTitle  string                          `xml:"routeTitle,attr"`
	RouteTag    string                          `xml:"routeTag,attr"`
	StopTitle   string                          `xml:"stopTitle,attr"`
	StopTag     string                          `xml:"stopTag,attr"`
	Directions  []PredictionsResponse_Direction `xml:"direction"`
	Message     PredictionsResponse_Message     `xml:"message"`
}

type Response

type Response struct {
	XMLName xml.Name        `xml:"body"`
	Error   *Response_Error `xml:"Error"`
}

type Response_Error

type Response_Error struct {
	ShouldRetry bool   `xml:"shouldRetry,attr"`
	Message     string `xml:",chardata"`
}

type RouteConfigResponse

type RouteConfigResponse struct {
	Response
	Route RouteConfigResponse_Route `xml:"route"`
}

type RouteConfigResponse_Direction

type RouteConfigResponse_Direction struct {
	Tag      string                        `xml:"tag,attr"`
	Title    string                        `xml:"title,attr"`
	Name     string                        `xml:"name,attr"`
	UseForUI bool                          `xml:"useForUI,attr"`
	Stops    []RouteConfigResponse_StopTag `xml:"stop"`
}

type RouteConfigResponse_Path

type RouteConfigResponse_Path struct {
	Points []RouteConfigResponse_Point `xml:"point"`
}

type RouteConfigResponse_Point

type RouteConfigResponse_Point struct {
	Lat float32 `xml:"lat,attr"`
	Lon float32 `xml:"lon,attr"`
}

type RouteConfigResponse_Route

type RouteConfigResponse_Route struct {
	Tag           string                          `xml:"tag,attr"`
	Title         string                          `xml:"title,attr"`
	Color         string                          `xml:"color,attr"`
	OppositeColor string                          `xml:"oppositeColor,attr"`
	LatMin        float32                         `xml:"latMin,attr"`
	LatMax        float32                         `xml:"latMax,attr"`
	LonMin        float32                         `xml:"lonMin,attr"`
	LonMax        float32                         `xml:"lonMax,attr"`
	Stops         []RouteConfigResponse_Stop      `xml:"stop"`
	Directions    []RouteConfigResponse_Direction `xml:"direction"`
	Paths         []RouteConfigResponse_Path      `xml:"path"`
}

type RouteConfigResponse_Stop

type RouteConfigResponse_Stop struct {
	Tag    string  `xml:"tag,attr"`
	Title  string  `xml:"title,attr"`
	StopID string  `xml:"stopId,attr"`
	Lat    float32 `xml:"lat,attr"`
	Lon    float32 `xml:"lon,attr"`
}

type RouteConfigResponse_StopTag

type RouteConfigResponse_StopTag struct {
	Tag string `xml:"tag,attr"`
}

type RouteListResponse

type RouteListResponse struct {
	Response
	Routes []RouteListResponse_Route `xml:"route"`
}

type RouteListResponse_Route

type RouteListResponse_Route struct {
	Tag   string `xml:"tag,attr"`
	Title string `xml:"title,attr"`
}

type ScheduleResponse

type ScheduleResponse struct {
	// TODO: not implemented
	Response
}

type VehicleLocationsResponse

type VehicleLocationsResponse struct {
	// TODO: not implemented
	Response
}

Jump to

Keyboard shortcuts

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