trv

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	XMLName xml.Name `xml:"ERROR"`
	Source  string   `xml:"SOURCE"`
	Message string   `xml:"MESSAGE"`
}

APIError is the error information that will be present if the API responds with an error to your request.

func (*APIError) Error

func (e *APIError) Error() string

type LastModified

type LastModified time.Time

LastModified represents the latest ModifiedTime of any object that was included in the response.

func (*LastModified) UnmarshalXML

func (lm *LastModified) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML unmarshals into an internal type first, so that we can access the datetime attribute and lift it out. Since datetime is an attribute and not an element, we can't use an xml:"LASTMODIFIED>datetime" tag to get to it.

type ObjectType

type ObjectType struct {
	Kind      string
	Version   string
	Namespace string
}

ObjectType holds metadata about an Object you can query for in the Trafikverket API.

The Kind is the object type, the version is the object version and the namespace, if necessary, that the object resides in. Namespaces are new to the API and are only present for certain versions of certain objects.

The ObjectType method in each public package will return this object with all information correctly filled in. It can be passed as the argument to code.dny.dev/trafikinfo.NewQuery.

Directories

Path Synopsis
camera
v1
Package v1 contains the type definitions for Camera v1.
Package v1 contains the type definitions for Camera v1.
ferryannouncement
v1dot2
Package v1dot2 contains the type definitions for FerryAnnouncement v1.2.
Package v1dot2 contains the type definitions for FerryAnnouncement v1.2.
ferryroute
v1dot2
Package v1dot2 contains the type definitions for FerryRoute v1.2.
Package v1dot2 contains the type definitions for FerryRoute v1.2.
icon
v1dot1
Package v1dot1 contains the type definitions for Icon v1.1.
Package v1dot1 contains the type definitions for Icon v1.1.
measurementdata100
v1
Package v1 contains the type definitions for MeasurementData100 v1.
Package v1 contains the type definitions for MeasurementData100 v1.
measurementdata20
v1
Package v1 contains the type definitions for MeasurementData20 v1.
Package v1 contains the type definitions for MeasurementData20 v1.
parking
v1dot4
Package v1dot4 contains the type definitions for Parking v1.4.
Package v1dot4 contains the type definitions for Parking v1.4.
pavementdata
v1
Package v1 contains the type definitions for PavementData v1.
Package v1 contains the type definitions for PavementData v1.
railcrossing
v1dot5
Package v1dot5 contains the type definitions for RailCrossing v1.5.
Package v1dot5 contains the type definitions for RailCrossing v1.5.
reasoncode
v1
Package v1 contains the type definitions for ReasonCode v1.
Package v1 contains the type definitions for ReasonCode v1.
roadcondition
v1dot2
Package v1dot2 contains the type definitions for RoadCondition v1.2.
Package v1dot2 contains the type definitions for RoadCondition v1.2.
roaddata
v1
Package v1 contains the type definitions for RoadData v1.
Package v1 contains the type definitions for RoadData v1.
roadgeometry
v1
Package v1 contains the type definitions for RoadGeometry v1.
Package v1 contains the type definitions for RoadGeometry v1.
situation
v1dot5
Package v1dot5 contains the type definitions for Situation v1.5.
Package v1dot5 contains the type definitions for Situation v1.5.
trafficflow
v1dot4
Package v1dot4 contains the type definitions for TrafficFlow v1.4.
Package v1dot4 contains the type definitions for TrafficFlow v1.4.
trafficsafetycamera
v1
Package v1 contains the type definitions for TrafficSafetyCamera v1.
Package v1 contains the type definitions for TrafficSafetyCamera v1.
trainannouncement
v1dot9
Package v1dot9 contains the type definitions for TrainAnnouncement v1.9.
Package v1dot9 contains the type definitions for TrainAnnouncement v1.9.
trainmessage
v1dot7
Package v1dot7 contains the type definitions for TrainMessage v1.7.
Package v1dot7 contains the type definitions for TrainMessage v1.7.
trainposition
v1dot1
Package v1dot1 contains the type definitions for TrainPosition v1.1.
Package v1dot1 contains the type definitions for TrainPosition v1.1.
trainstation
v1dot4
Package v1dot4 contains the type definitions for TrainStation v1.4.
Package v1dot4 contains the type definitions for TrainStation v1.4.
trainstationmessage
v1
Package v1 contains the type definitions for TrainStationMessage v1.
Package v1 contains the type definitions for TrainStationMessage v1.
traveltimeroute
v1dot5
Package v1dot5 contains the type definitions for TravelTimeRoute v1.5.
Package v1dot5 contains the type definitions for TravelTimeRoute v1.5.
weathermeasurepoint
v2
Package v2 contains the type definitions for WeatherMeasurepoint v2.
Package v2 contains the type definitions for WeatherMeasurepoint v2.
weatherobservation
v2
Package v2 contains the type definitions for WeatherObservation v2.
Package v2 contains the type definitions for WeatherObservation v2.

Jump to

Keyboard shortcuts

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