Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // Base URL for API requests. Defaults to https://www.wsdot.wa.gov/Ferries/API/. // BaseURL should always be specified with a trailing backslash. BaseURL *url.URL UserAgent string // Access code for the WSF API, provisioned at https://www.wsdot.wa.gov/Traffic/API/. // Requests will fail unless this is defined. AccessCode string //Different parts of the WSF API, referred to herin as Services. Vessels *VesselsService // contains filtered or unexported fields }
A Client manages communication with the WSF API.
type Time ¶
Time implements a custom JSON unmarsaller for the specific format of non-RFC 3339 time output by the WSF API. Cast the variable to a time.Time to get to the underlying type.
func (*Time) UnmarshalJSON ¶
UnmarshalJSON unmarshalls the time output by the WSF API
type VesselLocation ¶
type VesselLocation struct { VesselID int VesselName string Mmsi int `json:",omitempty"` DepartingTerminalID int DepartingTerminalName string DepartingTerminalAbbrev string ArrivingTerminalID int `json:",omitempty"` ArrivingTerminalName string `json:",omitempty"` ArrivingTerminalAbbrev string `json:",omitempty"` Latitude float64 Longitude float64 Speed float64 Heading float64 InService bool AtDock bool LeftDock Time `json:"LeftDock, string, omitempty"` Eta Time `json:"Eta, string, omitempty"` EtaBasis string `json:",omitempty"` ScheduledDeparture Time `json:"ScheduledDeparture, string, omitempty"` OpRouteAbbrev []string VesselPositionNum int `json:",omitempty"` SortSeq int ManagedBy int // Enum, 1 for WSF, and 2 for KCM TimeStamp Time `json:"TimeStamp, string"` }
VesselLocation is the location and related data for a single vessel.
type VesselLocations ¶
type VesselLocations []VesselLocation
VesselLocations is an array of VesselLocation, which should include every vessel tracked by the endpoint.
type VesselsService ¶
type VesselsService service
VesselsService handles communication with the WSF Vessels API, which includes vessel attributes, locations, and other vessel-specific data. For the corresponding WSF REST API documentation, see http://www.wsdot.wa.gov/ferries/api/vessels/documentation/rest.html
func (*VesselsService) VesselLocations ¶
func (s *VesselsService) VesselLocations() (*VesselLocations, error)
VesselLocations returns an array of every tracked vessel's location data, along with some other related information. This is updated frequently on the endpoint. See http://www.wsdot.wa.gov/Ferries/API/vessels/rest/vessellocations