v1dot5

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 v1dot5 contains the type definitions for Situation v1.5.

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 Deviation

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

func (*Deviation) AffectedDirection

func (x *Deviation) AffectedDirection() *string

SV: Påverkad riktning (Båda riktningarna, En riktning)

func (*Deviation) AffectedDirectionValue

func (x *Deviation) AffectedDirectionValue() *string

SV: <div class="toggleTitle">Påverkad riktningsvärde</div> <div class="toggle arrowR"> </div> <div class="toggleContent"> <table class="table table-condensed"> <tr> <td>BothDirections</td> <td>Båda riktningarna är påverkade</td> </tr> <tr> <td>OneDirection</td> <td>En rikting påverkad. I de fall Deviation.Geometry.Line är definierad så är dess koordinater ordnade efter riktingen.</td> </tr> </table> </div>

func (*Deviation) Counties

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

SV: <div class="toggleTitle">Länsnummer</div> <div class="toggle arrowR"> </div> <div class="toggleContent"> <table class="table table-condensed"> <tr> <td>0</td> <td>Alla län (kan förekomma för poster med Deviation.MessageType="Viktig trafikinformation" och meddelandet gäller då för hela Sverige)</td> </tr> <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 (*Deviation) CreationTime

func (x *Deviation) CreationTime() *time.Time

SV: Tidpunkt då dataposten skapades

func (*Deviation) Creator

func (x *Deviation) Creator() *string

SV: Källa till datat

func (*Deviation) EndTime

func (x *Deviation) EndTime() *time.Time

SV: Dataposten är giltig till och med

func (*Deviation) Geometry

func (x *Deviation) Geometry() *Geometry

func (*Deviation) Header

func (x *Deviation) Header() *string

SV: Titel

func (*Deviation) ID

func (x *Deviation) ID() *string

SV: Datapostens id

func (*Deviation) IconID

func (x *Deviation) IconID() *string

SV: Ikonid

func (*Deviation) Images

func (x *Deviation) Images() []Image

func (*Deviation) JourneyReference

func (x *Deviation) JourneyReference() *string

SV: Färjeled

func (*Deviation) LocationDescriptor

func (x *Deviation) LocationDescriptor() *string

SV: Beskrivning av position

func (*Deviation) ManagedCause

func (x *Deviation) ManagedCause() *bool

SV: Objektet är orsaken till situationen

func (*Deviation) Message

func (x *Deviation) Message() *string

SV: Meddelandetext

func (*Deviation) MessageCode

func (x *Deviation) MessageCode() *string

SV: Meddelandekod, ex. "Beläggningsarbete"

func (*Deviation) MessageCodeValue

func (x *Deviation) MessageCodeValue() *string

SV: Meddelandekodsvärde, ex. "resurfacingWork"

func (*Deviation) MessageType

func (x *Deviation) MessageType() *string

SV: <div class="toggleTitle">Meddelandetyp, ex: "Vägarbete"</div> <div class="toggle arrowR"> </div> <div class="toggleContent"> "Viktig trafikinformation"<br /> "Färjor"<br /> "Hinder"<br /> "Olycka"<br /> "Restriktion"<br /> "Trafikmeddelande"<br /> "Vägarbete"<br /></div>

func (*Deviation) MessageTypeValue

func (x *Deviation) MessageTypeValue() *string

SV: Meddelandetypsvärde, ex: "MaintenanceWorks"

func (*Deviation) NumberOfLanesRestricted

func (x *Deviation) NumberOfLanesRestricted() *int

SV: Antal påverkade körfält

func (*Deviation) PositionalDescription

func (x *Deviation) PositionalDescription() *string

SV: Påverkad del, ex. "vägren"

func (*Deviation) RoadName

func (x *Deviation) RoadName() *string

SV: Vägnamn

func (*Deviation) RoadNumber

func (x *Deviation) RoadNumber() *string

SV: Vägnummer, ex. "Väg 73"

func (*Deviation) RoadNumberNumeric

func (x *Deviation) RoadNumberNumeric() *int

SV: Vägnummer som nummeriskt värde, ex: 73

func (*Deviation) SafetyRelatedMessage

func (x *Deviation) SafetyRelatedMessage() *bool

SV: Indikerar att meddelandet är säkerhetsrelaterat i enlighet med Kommisionens Delegerade Förordning (EU) nr 886/2013 vad gäller data och förfaranden för kostnadsfritt tillhandahållande, när så är möjligt, av ett minimum av vägsäkerhetsrelaterad universell trafikinformation för användare.

func (*Deviation) Schedules

func (x *Deviation) Schedules() []Schedule

func (*Deviation) SeverityCode

func (x *Deviation) SeverityCode() *int

SV: Påverkansgrad, värden: 1, 2, 4, 5

func (*Deviation) SeverityText

func (x *Deviation) SeverityText() *string

SV: <div class="toggleTitle"> Påverkan: </div> <div class="toggle arrowR"> </div> <div class="toggleContent"> "Ingen påverkan"<br /> "Liten påverkan"<br /> "Stor påverkan"<br /> "Mycket stor påverkan" </div>

func (*Deviation) StartTime

func (x *Deviation) StartTime() *time.Time

SV: Dataposten är giltig från och med

func (*Deviation) TemporaryLimit

func (x *Deviation) TemporaryLimit() *string

SV: Tillfälliga begränsningar, ex. "bruttovikt 8 ton"

func (*Deviation) TrafficRestrictionType

func (x *Deviation) TrafficRestrictionType() *string

SV: Trafikrestriktion, ex. "körfält blockerat"

func (*Deviation) UnmarshalXML

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

func (*Deviation) ValidUntilFurtherNotice

func (x *Deviation) ValidUntilFurtherNotice() *bool

SV: Dataposten gäller på obestämd framtid

func (*Deviation) VersionTime

func (x *Deviation) VersionTime() *time.Time

SV: Aktuell versionstid för störningen

func (x *Deviation) WebLink() *string

SV: Url till mer information

type GeoLine

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

func (*GeoLine) SWEREF99TM

func (x *GeoLine) SWEREF99TM() *string

SV: Geometrisk linje i koordinatsystem SWEREF99TM

func (*GeoLine) UnmarshalXML

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

func (*GeoLine) WGS84

func (x *GeoLine) WGS84() *string

SV: Geometrisk linje i koordinatsystem WGS84

type GeoPoint

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

func (*GeoPoint) SWEREF99TM

func (x *GeoPoint) SWEREF99TM() *string

SV: Geometrisk punkt i koordinatsystem SWEREF99TM

func (*GeoPoint) UnmarshalXML

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

func (*GeoPoint) WGS84

func (x *GeoPoint) WGS84() *string

SV: Geometrisk punkt i koordinatsystem WGS84

type Geometry

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

func (*Geometry) Line

func (x *Geometry) Line() *GeoLine

func (*Geometry) Point

func (x *Geometry) Point() *GeoPoint

func (*Geometry) UnmarshalXML

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

type Image

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

func (*Image) HasFullSizePhoto

func (x *Image) HasFullSizePhoto() *bool

SV: Gäller för meddelandetyp 'Viktig trafikinformation': anger om det finns ett högupplöst foto

func (*Image) URL

func (x *Image) URL() *string

SV: Gäller för meddelandetyp 'Viktig trafikinformation': bildens URL

func (*Image) UnmarshalXML

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

type RecurringTimePeriodOfDay

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

func (*RecurringTimePeriodOfDay) End

func (x *RecurringTimePeriodOfDay) End() *string

SV: Per dag återkommande aktiv till och med tidpunkt, ex: "16:00"

func (*RecurringTimePeriodOfDay) Start

func (x *RecurringTimePeriodOfDay) Start() *string

SV: Per dag återkommande aktiv från och med tidpunkt, ex. "07:00"

func (*RecurringTimePeriodOfDay) UnmarshalXML

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

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  []Situation   `xml:"Situation"`
	} `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/situation/v1dot5"
)

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 Schedule

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

func (*Schedule) EndOfPeriod

func (x *Schedule) EndOfPeriod() *time.Time

SV: Objektet är aktivt till och med period

func (*Schedule) RecurringTimePeriodOfDays

func (x *Schedule) RecurringTimePeriodOfDays() []RecurringTimePeriodOfDay

func (*Schedule) StartOfPeriod

func (x *Schedule) StartOfPeriod() *time.Time

SV: Objektet är aktivt från och med period

func (*Schedule) UnmarshalXML

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

type Situation

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

func (*Situation) CountryCode

func (x *Situation) CountryCode() *string

SV: <div class="toggleTitle">Landsbeteckning</div> <div class="toggle arrowR"> </div> <div class="toggleContent"> "DE" - Tyskland<br /> "DK" - Danmark<br /> "NO" - Norge<br /> "SE" - Sverige </div>

func (*Situation) Deleted

func (x *Situation) Deleted() *bool

SV: Anger att dataposten raderats

func (*Situation) Deviations

func (x *Situation) Deviations() []Deviation

func (*Situation) ID

func (x *Situation) ID() *string

SV: Datapostens id

func (*Situation) ModifiedTime

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

SV: Tidpunkt då dataposten ändrades

func (*Situation) PublicationTime

func (x *Situation) PublicationTime() *time.Time

SV: Tidpunkt då dataposten publicerades

func (*Situation) UnmarshalXML

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

func (*Situation) VersionTime

func (x *Situation) VersionTime() *time.Time

SV: Aktuell versionstid för situationen

Jump to

Keyboard shortcuts

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