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 ¶
- func ObjectType() trv.ObjectType
- type Geometry
- type Response
- type TrainStation
- func (x *TrainStation) Advertised() *bool
- func (x *TrainStation) AdvertisedLocationName() *string
- func (x *TrainStation) AdvertisedShortLocationName() *string
- func (x *TrainStation) Counties() []int
- func (x *TrainStation) CountryCode() *string
- func (x *TrainStation) Deleted() *bool
- func (x *TrainStation) Geometry() *Geometry
- func (x *TrainStation) LocationInformationText() *string
- func (x *TrainStation) LocationSignature() *string
- func (x *TrainStation) ModifiedTime() *time.Time
- func (x *TrainStation) OfficialLocationName() *string
- func (x *TrainStation) PlatformLines() []string
- func (x *TrainStation) Prognosticated() *bool
- func (x *TrainStation) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
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 ¶
SV: Geometrisk punkt i koordinatsystem SWEREF99TM EN: Geometric point in coordinate system SWEREF99TM
func (*Geometry) UnmarshalXML ¶
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) }
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