Documentation ¶
Overview ¶
Package v2 contains the type definitions for WeatherMeasurepoint v2.
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 Aggregated
- type AirCondition
- func (x *AirCondition) CloudFree() *bool
- func (x *AirCondition) Dewpoint() *Celsius
- func (x *AirCondition) RelativeHumidity() *Percentage
- func (x *AirCondition) Temperature() *Celsius
- func (x *AirCondition) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
- func (x *AirCondition) VisibleDistance() *Meters
- type Celsius
- type Degrees
- type DeicingChemical
- type Geometry
- type GramPerSquareMeter
- type Grip
- type GroundCondition
- type IntegerCentimeters
- type Meters
- type MetersPerSecond
- type Millimeters
- type Observation
- func (x *Observation) Aggregated10minutes() *Aggregated
- func (x *Observation) Aggregated30minutes() *Aggregated
- func (x *Observation) Aggregated5minutes() *Aggregated
- func (x *Observation) Air() *AirCondition
- func (x *Observation) DeicingChemical() *DeicingChemical
- func (x *Observation) ID() *string
- func (x *Observation) Sample() *time.Time
- func (x *Observation) Subsurface() *SubsurfaceCondition
- func (x *Observation) Surface() *SurfaceCondition
- func (x *Observation) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
- func (x *Observation) Weather() *Weather
- func (x *Observation) Wind() []WindCondition
- type Origin
- type Percentage
- type PrecipTypeMeasure
- type PrecipitationConditionAggregated
- func (x *PrecipitationConditionAggregated) Rain() *bool
- func (x *PrecipitationConditionAggregated) RainSum() *Millimeters
- func (x *PrecipitationConditionAggregated) Snow() *bool
- func (x *PrecipitationConditionAggregated) SnowSum() *Snow
- func (x *PrecipitationConditionAggregated) TotalWaterEquivalent() *Millimeters
- func (x *PrecipitationConditionAggregated) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
- type Response
- type Snow
- type SubsurfaceCondition
- type SurfaceCondition
- func (x *SurfaceCondition) Grip() *Grip
- func (x *SurfaceCondition) Ice() *bool
- func (x *SurfaceCondition) IceDepth() *Millimeters
- func (x *SurfaceCondition) Snow() *bool
- func (x *SurfaceCondition) SnowDepth() *Snow
- func (x *SurfaceCondition) Temperature() *Celsius
- func (x *SurfaceCondition) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
- func (x *SurfaceCondition) Water() *bool
- func (x *SurfaceCondition) WaterDepth() *Millimeters
- type Weather
- type WeatherMeasurepoint
- func (x *WeatherMeasurepoint) Deleted() *bool
- func (x *WeatherMeasurepoint) Geometry() *Geometry
- func (x *WeatherMeasurepoint) ID() *string
- func (x *WeatherMeasurepoint) ModifiedTime() *time.Time
- func (x *WeatherMeasurepoint) Name() *string
- func (x *WeatherMeasurepoint) Observation() *Observation
- func (x *WeatherMeasurepoint) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
- type WindCondition
- type WindConditionAggregated
- type WindSensorHeight
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ObjectType ¶
func ObjectType() trv.ObjectType
Types ¶
type Aggregated ¶
type Aggregated struct {
// contains filtered or unexported fields
}
func (*Aggregated) Precipitation ¶
func (x *Aggregated) Precipitation() *PrecipitationConditionAggregated
func (*Aggregated) UnmarshalXML ¶
func (x *Aggregated) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
func (*Aggregated) Wind ¶
func (x *Aggregated) Wind() *WindConditionAggregated
type AirCondition ¶
type AirCondition struct {
// contains filtered or unexported fields
}
func (*AirCondition) CloudFree ¶
func (x *AirCondition) CloudFree() *bool
SV: Förekomst av tillräckligt klart väder för att vara av vikt för vägytans temperatur.
func (*AirCondition) Dewpoint ¶
func (x *AirCondition) Dewpoint() *Celsius
SV: Daggpunkt, den temperatur där vatten kondenserar. Value [C]
func (*AirCondition) RelativeHumidity ¶
func (x *AirCondition) RelativeHumidity() *Percentage
SV: Relativ luftfuktighet. Andel av den fukt som luften kan bära. Vid 100% är luften mättad. Value [%]
func (*AirCondition) Temperature ¶
func (x *AirCondition) Temperature() *Celsius
SV: Lufttemperatur. Value [C]
func (*AirCondition) UnmarshalXML ¶
func (x *AirCondition) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
func (*AirCondition) VisibleDistance ¶
func (x *AirCondition) VisibleDistance() *Meters
SV: Den sträcka det finns sikt. Value [m]
type Celsius ¶
type Celsius struct {
// contains filtered or unexported fields
}
func (*Celsius) UnmarshalXML ¶
type Degrees ¶
type Degrees struct {
// contains filtered or unexported fields
}
func (*Degrees) UnmarshalXML ¶
type DeicingChemical ¶
type DeicingChemical struct {
// contains filtered or unexported fields
}
func (*DeicingChemical) Amount ¶
func (x *DeicingChemical) Amount() *GramPerSquareMeter
SV: Mängd salt vid mätpunkten. Value g/kvm
func (*DeicingChemical) UnmarshalXML ¶
func (x *DeicingChemical) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
type Geometry ¶
type Geometry struct {
// contains filtered or unexported fields
}
func (*Geometry) SWEREF99TM ¶
SV: Geometrisk punkt som observationen avser i koordinatsystem SWEREF99TM
func (*Geometry) UnmarshalXML ¶
type GramPerSquareMeter ¶
type GramPerSquareMeter struct {
// contains filtered or unexported fields
}
func (*GramPerSquareMeter) Origin ¶
func (x *GramPerSquareMeter) Origin() *Origin
SV: Mätvärdets ursprung
func (*GramPerSquareMeter) SensorNames ¶
func (x *GramPerSquareMeter) SensorNames() *string
SV: Sensorernas beteckning
func (*GramPerSquareMeter) UnmarshalXML ¶
func (x *GramPerSquareMeter) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
func (*GramPerSquareMeter) Value ¶
func (x *GramPerSquareMeter) Value() *float64
type Grip ¶
type Grip struct {
// contains filtered or unexported fields
}
func (*Grip) UnmarshalXML ¶
type GroundCondition ¶
type GroundCondition struct {
// contains filtered or unexported fields
}
func (*GroundCondition) Depth ¶
func (x *GroundCondition) Depth() *IntegerCentimeters
SV: Det djup som observationen avser och är negativt för att återspegla att det avser under markytan. Value [cm]
func (*GroundCondition) Temperature ¶
func (x *GroundCondition) Temperature() *Celsius
SV: Temperatur (grader celsius) vid ett visst djup i marken. Value [C]
func (*GroundCondition) UnmarshalXML ¶
func (x *GroundCondition) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
type IntegerCentimeters ¶
type IntegerCentimeters struct {
// contains filtered or unexported fields
}
func (*IntegerCentimeters) Origin ¶
func (x *IntegerCentimeters) Origin() *Origin
SV: Mätvärdets ursprung
func (*IntegerCentimeters) SensorNames ¶
func (x *IntegerCentimeters) SensorNames() *string
SV: Sensorernas beteckning
func (*IntegerCentimeters) UnmarshalXML ¶
func (x *IntegerCentimeters) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
func (*IntegerCentimeters) Value ¶
func (x *IntegerCentimeters) Value() *int
type Meters ¶
type Meters struct {
// contains filtered or unexported fields
}
func (*Meters) UnmarshalXML ¶
type MetersPerSecond ¶
type MetersPerSecond struct {
// contains filtered or unexported fields
}
func (*MetersPerSecond) SensorNames ¶
func (x *MetersPerSecond) SensorNames() *string
SV: Sensorernas beteckning
func (*MetersPerSecond) UnmarshalXML ¶
func (x *MetersPerSecond) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
func (*MetersPerSecond) Value ¶
func (x *MetersPerSecond) Value() *float64
type Millimeters ¶
type Millimeters struct {
// contains filtered or unexported fields
}
func (*Millimeters) SensorNames ¶
func (x *Millimeters) SensorNames() *string
SV: Sensorernas beteckning
func (*Millimeters) UnmarshalXML ¶
func (x *Millimeters) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
func (*Millimeters) Value ¶
func (x *Millimeters) Value() *float64
type Observation ¶
type Observation struct {
// contains filtered or unexported fields
}
func (*Observation) Aggregated10minutes ¶
func (x *Observation) Aggregated10minutes() *Aggregated
func (*Observation) Aggregated30minutes ¶
func (x *Observation) Aggregated30minutes() *Aggregated
func (*Observation) Aggregated5minutes ¶
func (x *Observation) Aggregated5minutes() *Aggregated
func (*Observation) Air ¶
func (x *Observation) Air() *AirCondition
func (*Observation) DeicingChemical ¶
func (x *Observation) DeicingChemical() *DeicingChemical
func (*Observation) ID ¶
func (x *Observation) ID() *string
SV: Unik publiceringsidentitet för observationen.
func (*Observation) Sample ¶
func (x *Observation) Sample() *time.Time
SV: Tidpunkt som observationen avser, inklusive tidzon för att hantera sommartid och normaltid.
func (*Observation) Subsurface ¶
func (x *Observation) Subsurface() *SubsurfaceCondition
func (*Observation) Surface ¶
func (x *Observation) Surface() *SurfaceCondition
func (*Observation) UnmarshalXML ¶
func (x *Observation) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
func (*Observation) Weather ¶
func (x *Observation) Weather() *Weather
func (*Observation) Wind ¶
func (x *Observation) Wind() []WindCondition
type Percentage ¶
type Percentage struct {
// contains filtered or unexported fields
}
func (*Percentage) SensorNames ¶
func (x *Percentage) SensorNames() *string
SV: Sensorernas beteckning
func (*Percentage) UnmarshalXML ¶
func (x *Percentage) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
func (*Percentage) Value ¶
func (x *Percentage) Value() *float64
type PrecipTypeMeasure ¶ added in v0.7.1
type PrecipTypeMeasure string
const ( PrecipTypeMeasureNo PrecipTypeMeasure = "no" PrecipTypeMeasureRain PrecipTypeMeasure = "rain" PrecipTypeMeasureFreezingRain PrecipTypeMeasure = "freezing_rain" PrecipTypeMeasureSnow PrecipTypeMeasure = "snow" PrecipTypeMeasureSleet PrecipTypeMeasure = "sleet" PrecipTypeMeasureYes PrecipTypeMeasure = "yes" )
type PrecipitationConditionAggregated ¶
type PrecipitationConditionAggregated struct {
// contains filtered or unexported fields
}
func (*PrecipitationConditionAggregated) Rain ¶
func (x *PrecipitationConditionAggregated) Rain() *bool
SV: Förekomst av regn.
func (*PrecipitationConditionAggregated) RainSum ¶
func (x *PrecipitationConditionAggregated) RainSum() *Millimeters
SV: Mängd regn under perioden. Value [mm]
func (*PrecipitationConditionAggregated) Snow ¶
func (x *PrecipitationConditionAggregated) Snow() *bool
SV: Förekomst av snö.
func (*PrecipitationConditionAggregated) SnowSum ¶
func (x *PrecipitationConditionAggregated) SnowSum() *Snow
SV: Mängd snö under perioden.
func (*PrecipitationConditionAggregated) TotalWaterEquivalent ¶
func (x *PrecipitationConditionAggregated) TotalWaterEquivalent() *Millimeters
SV: Mängd vatten som nederbörden under perioden motsvarar. Value [mm]
func (*PrecipitationConditionAggregated) UnmarshalXML ¶
func (x *PrecipitationConditionAggregated) 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 []WeatherMeasurepoint `xml:"WeatherMeasurepoint"` } `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/weathermeasurepoint/v2" ) func main() { var res api.Response err := xml.Unmarshal(data, &res) }
type Snow ¶
type Snow struct {
// contains filtered or unexported fields
}
func (*Snow) UnmarshalXML ¶
func (*Snow) WaterEquivalent ¶
func (x *Snow) WaterEquivalent() *Millimeters
SV: Mängd vatten som snön motsvarar i smält form. Value [mm]
type SubsurfaceCondition ¶
type SubsurfaceCondition struct {
// contains filtered or unexported fields
}
func (*SubsurfaceCondition) Ground ¶
func (x *SubsurfaceCondition) Ground() []GroundCondition
func (*SubsurfaceCondition) UnmarshalXML ¶
func (x *SubsurfaceCondition) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
type SurfaceCondition ¶
type SurfaceCondition struct {
// contains filtered or unexported fields
}
func (*SurfaceCondition) Ice ¶
func (x *SurfaceCondition) Ice() *bool
SV: Förekomst av is på vägytan.
func (*SurfaceCondition) IceDepth ¶
func (x *SurfaceCondition) IceDepth() *Millimeters
SV: Isdjup på vägytan. Value [mm]
func (*SurfaceCondition) Snow ¶
func (x *SurfaceCondition) Snow() *bool
SV: Förekomst av snö på vägytan.
func (*SurfaceCondition) SnowDepth ¶
func (x *SurfaceCondition) SnowDepth() *Snow
SV: Snödjup på vägytan.
func (*SurfaceCondition) Temperature ¶
func (x *SurfaceCondition) Temperature() *Celsius
SV: Vägytans temperatur. Value [C]
func (*SurfaceCondition) UnmarshalXML ¶
func (x *SurfaceCondition) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
func (*SurfaceCondition) Water ¶
func (x *SurfaceCondition) Water() *bool
SV: Förekomst av vatten på vägytan.
func (*SurfaceCondition) WaterDepth ¶
func (x *SurfaceCondition) WaterDepth() *Millimeters
SV: Vattendjup på vägytan. Value [mm]
type Weather ¶
type Weather struct {
// contains filtered or unexported fields
}
func (*Weather) Precipitation ¶
func (x *Weather) Precipitation() *PrecipTypeMeasure
SV: Vilken typ av nederbörd som detekterats
func (*Weather) UnmarshalXML ¶
type WeatherMeasurepoint ¶
type WeatherMeasurepoint struct {
// contains filtered or unexported fields
}
func (*WeatherMeasurepoint) Deleted ¶
func (x *WeatherMeasurepoint) Deleted() *bool
SV: Anger att dataposten raderats EN: Indicates that the data record has been deleted
func (*WeatherMeasurepoint) Geometry ¶
func (x *WeatherMeasurepoint) Geometry() *Geometry
func (*WeatherMeasurepoint) ID ¶
func (x *WeatherMeasurepoint) ID() *string
SV: Unik identitet för en mätpunkt
func (*WeatherMeasurepoint) ModifiedTime ¶
func (x *WeatherMeasurepoint) ModifiedTime() *time.Time
SV: Tidpunkt då dataposten ändrades i cachen EN: Time when the data item was changed in the cache
func (*WeatherMeasurepoint) Name ¶
func (x *WeatherMeasurepoint) Name() *string
SV: Mätpunktens namn
func (*WeatherMeasurepoint) Observation ¶
func (x *WeatherMeasurepoint) Observation() *Observation
func (*WeatherMeasurepoint) UnmarshalXML ¶
func (x *WeatherMeasurepoint) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
type WindCondition ¶
type WindCondition struct {
// contains filtered or unexported fields
}
func (*WindCondition) Direction ¶
func (x *WindCondition) Direction() *Degrees
SV: Mått på vindriktning vid en viss tidpunkt. Medelvärde över tiominutersperiod t.o.m. tidpunkten. Value [grader]
func (*WindCondition) Height ¶
func (x *WindCondition) Height() *WindSensorHeight
func (*WindCondition) Speed ¶
func (x *WindCondition) Speed() *MetersPerSecond
SV: Mått på vindhastighet vid en viss tidpunkt. Medelvärde över tiominutersperiod t.o.m. tidpunkten. Value m/s
func (*WindCondition) UnmarshalXML ¶
func (x *WindCondition) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
type WindConditionAggregated ¶
type WindConditionAggregated struct {
// contains filtered or unexported fields
}
func (*WindConditionAggregated) Height ¶
func (x *WindConditionAggregated) Height() *WindSensorHeight
func (*WindConditionAggregated) SpeedAverage ¶
func (x *WindConditionAggregated) SpeedAverage() *MetersPerSecond
SV: Value m/s
func (*WindConditionAggregated) SpeedMax ¶
func (x *WindConditionAggregated) SpeedMax() *MetersPerSecond
SV: Högst uppmätt 3-sekundersmedelvärde under perioden. Value m/s
func (*WindConditionAggregated) UnmarshalXML ¶
func (x *WindConditionAggregated) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
type WindSensorHeight ¶ added in v0.7.1
type WindSensorHeight int
SV: Vindsensorns höjdplacering [m]
const ( WindSensorHeight6 WindSensorHeight = 6 WindSensorHeight10 WindSensorHeight = 10 )