Documentation ¶
Overview ¶
Package v1 contains the type definitions for TrafficSafetyCamera v1.
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 TrafficSafetyCamera
- func (x *TrafficSafetyCamera) Bearing() *int
- func (x *TrafficSafetyCamera) Counties() []int
- func (x *TrafficSafetyCamera) Deleted() *bool
- func (x *TrafficSafetyCamera) Geometry() *Geometry
- func (x *TrafficSafetyCamera) ID() *string
- func (x *TrafficSafetyCamera) IconID() *string
- func (x *TrafficSafetyCamera) ModifiedTime() *time.Time
- func (x *TrafficSafetyCamera) Name() *string
- func (x *TrafficSafetyCamera) RoadNumber() *string
- func (x *TrafficSafetyCamera) 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
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 []TrafficSafetyCamera `xml:"TrafficSafetyCamera"` } `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/trafficsafetycamera/v1" ) func main() { var res api.Response err := xml.Unmarshal(data, &res) }
type TrafficSafetyCamera ¶
type TrafficSafetyCamera struct {
// contains filtered or unexported fields
}
func (*TrafficSafetyCamera) Bearing ¶
func (x *TrafficSafetyCamera) Bearing() *int
SV: Vilket håll kameran är riktad mot. Medsols grader från norr EN: Which direction the camera is aimed at. Clockwise degrees from the north
func (*TrafficSafetyCamera) Counties ¶
func (x *TrafficSafetyCamera) 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 (*TrafficSafetyCamera) Deleted ¶
func (x *TrafficSafetyCamera) Deleted() *bool
func (*TrafficSafetyCamera) Geometry ¶
func (x *TrafficSafetyCamera) Geometry() *Geometry
func (*TrafficSafetyCamera) ID ¶
func (x *TrafficSafetyCamera) ID() *string
SV: Unikt id för kameran EN: Uniquely id for the camera
func (*TrafficSafetyCamera) IconID ¶
func (x *TrafficSafetyCamera) IconID() *string
SV: Anger ikonid för kameratypen EN: Describe iconid for camera type
func (*TrafficSafetyCamera) ModifiedTime ¶
func (x *TrafficSafetyCamera) ModifiedTime() *time.Time
EN: Specifies when the object is stored. SV: Anger när objektet är sparat.
func (*TrafficSafetyCamera) Name ¶
func (x *TrafficSafetyCamera) Name() *string
SV: Namn på kameran EN: Name on the camera
func (*TrafficSafetyCamera) RoadNumber ¶
func (x *TrafficSafetyCamera) RoadNumber() *string
SV: Vägnummer som mätplatsen står vid EN: Roadnumber which the measuring point stands at
func (*TrafficSafetyCamera) UnmarshalXML ¶
func (x *TrafficSafetyCamera) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error