v1dot4

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: 5 Imported by: 0

Documentation

Overview

Package v1dot4 contains the type definitions for TrainStation v1.4.

All types have accessor methods to access fields which can be chained on nils. This makes it possible to easily drill down into deeply nested data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ObjectType

func ObjectType() trv.ObjectType

Types

type Geometry

type Geometry struct {
	// contains filtered or unexported fields
}

func (*Geometry) SWEREF99TM

func (x *Geometry) SWEREF99TM() *string

SV: Geometrisk punkt i koordinatsystem SWEREF99TM EN: Geometric point in coordinate system SWEREF99TM

func (*Geometry) UnmarshalXML

func (x *Geometry) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

func (*Geometry) WGS84

func (x *Geometry) WGS84() *string

SV: Geometrisk punkt i koordinatsystem WGS84 EN: Geometric point in coordinate system WGS84

type Response

type Response struct {
	XMLName xml.Name `xml:"RESPONSE"`
	Results []struct {
		Info struct {
			LastModified trv.LastModified `xml:"LASTMODIFIED"`
			LastChangeID string           `xml:"LASTCHANGEID"`
			EvalResult   []any            `xml:"EVALRESULT"`
			SSEURL       string           `xml:"SSEURL"`
		} `xml:"INFO"`
		Error *trv.APIError  `xml:"ERROR"`
		Data  []TrainStation `xml:"TrainStation"`
	} `xml:"RESULT"`
}

Response can be used to decode the response from the API.

For example:

package main

import (
	 "encoding/xml"
	 api "code.dny.dev/trafikinfo/trv/trainstation/v1dot4"
)

func main() {
	var res api.Response
	err := xml.Unmarshal(data, &res)
}

func (Response) ErrorMsg

func (r Response) ErrorMsg() string

Errors returns a slice of trv.Error, if any error was included in the response.

func (Response) HasErrors

func (r Response) HasErrors() bool

HasErrors returns whether any of the results includes an error.

type TrainStation

type TrainStation struct {
	// contains filtered or unexported fields
}

func (*TrainStation) Advertised

func (x *TrainStation) Advertised() *bool

SV: Anger om stationen annonseras i tidtabell EN: Indicates if the station is advertised in the timetable

func (*TrainStation) AdvertisedLocationName

func (x *TrainStation) AdvertisedLocationName() *string

SV: Stationens namn EN: Stations name

func (*TrainStation) AdvertisedShortLocationName

func (x *TrainStation) AdvertisedShortLocationName() *string

SV: Stationens namn i kort version EN: Stations name in short version

func (*TrainStation) Counties

func (x *TrainStation) Counties() []int

SV: <div class="toggleTitle">Länsnummer</div> <div class="toggle arrowR"> </div> <div class="toggleContent"> <table class="table table-condensed"> <tr> <td>1</td> <td>Stockholms län</td> </tr> <tr> <td>2</td> <td> DEPRECATED<br /> Användes tidigare för Stockholms län </td> </tr> <tr> <td>3</td> <td>Uppsala län</td> </tr> <tr> <td>4</td> <td>Södermanlands län</td> </tr> <tr> <td>5</td> <td>Östergötlands län</td> </tr> <tr> <td>6</td> <td>Jönköpings län</td> </tr> <tr> <td>7</td> <td>Kronobergs län</td> </tr> <tr> <td>8</td> <td>Kalmar län</td> </tr> <tr> <td>9</td> <td>Gotlands län</td> </tr> <tr> <td>10</td> <td>Blekinge län</td> </tr> <tr> <td>12</td> <td>Skåne län</td> </tr> <tr> <td>13</td> <td>Hallands län</td> </tr> <tr> <td>14</td> <td>Västra Götalands län</td> </tr> <tr> <td>17</td> <td>Värmlands län</td> </tr> <tr> <td>18</td> <td>Örebro län</td> </tr> <tr> <td>19</td> <td>Västmanlands län</td> </tr> <tr> <td>20</td> <td>Dalarnas län</td> </tr> <tr> <td>21</td> <td>Gävleborgs län</td> </tr> <tr> <td>22</td> <td>Västernorrlands län</td> </tr> <tr> <td>23</td> <td>Jämtlands län</td> </tr> <tr> <td>24</td> <td>Västerbottens län</td> </tr> <tr> <td>25</td> <td>Norrbottens län</td> </tr> </table> </div>

func (*TrainStation) CountryCode

func (x *TrainStation) CountryCode() *string

SV: Beteckning för i vilket land stationen finns.<br /> 'DE' - Tyskland<br /> 'DK' - Danmark<br /> 'NO' - Norge<br /> 'SE' - Sverige EN: Designation of the country in which the station is located.<br /> 'DE' - Germany<br /> 'DK' - Denmark<br /> 'NO' - Norway<br /> 'SE' - Sweden

func (*TrainStation) Deleted

func (x *TrainStation) Deleted() *bool

func (*TrainStation) Geometry

func (x *TrainStation) Geometry() *Geometry

func (*TrainStation) LocationInformationText

func (x *TrainStation) LocationInformationText() *string

SV: Upplysningsinformation för stationen, ex. "SL-tåg omfattas ej.", "Ring 033-172444 för trafikinformation" EN: Disclosure information for the station, ex. "SL-train is excluded.", "Call 033-172444 for trafficinfomation"

func (*TrainStation) LocationSignature

func (x *TrainStation) LocationSignature() *string

SV: Stationens unika signatur, ex. "Cst" EN: Stations unique signature, ex. "Cst"

func (*TrainStation) ModifiedTime

func (x *TrainStation) ModifiedTime() *time.Time

EN: Specifies when the object is stored. SV: Anger när objektet är sparat.

func (*TrainStation) OfficialLocationName

func (x *TrainStation) OfficialLocationName() *string

SV: Det av Transportstyrelsen fastslagna officiella namnet på stationen EN: The official name of the station established by the Swedish Transport Agency

func (*TrainStation) PlatformLines

func (x *TrainStation) PlatformLines() []string

SV: Plattformens spår EN: Platform Tracks

func (*TrainStation) Prognosticated

func (x *TrainStation) Prognosticated() *bool

SV: Anger om stationen prognostiseras i tidtabell EN: Specifies if station forecasted in timetabell

func (*TrainStation) UnmarshalXML

func (x *TrainStation) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

Jump to

Keyboard shortcuts

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