Documentation ¶
Index ¶
Constants ¶
View Source
const ( OpenMeteoAPIUrl = "https://api.open-meteo.com/v1/forecast" // CoordinatesNotFoundErrorMessage = "coordinates section is required to evaluate weather" TemperatureNotFoundErrorMessage = "temperature section is required to evaluate weather" HttpUrlParsingErrorMessage = "error configuring http request: %s" HttpRequestFailedErrorMessage = "error performing http request: %s" HttpResponseReadFailedErrorMessage = "error reading http response's body: %s" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HourlySpec ¶
type HourlySpec struct { Time []string `json:"time"` Temperature2m []float64 `json:"temperature_2m"` ApparentTemperature []float64 `json:"apparent_temperature"` }
HourlySpec TODO
type HourlyUnitsSpec ¶
type HourlyUnitsSpec struct { Time string `json:"time"` Temperature2m string `json:"temperature_2m"` ApparentTemperature string `json:"apparent_temperature"` }
HourlyUnitsSpec TODO
type OpenMeteoResponseSpec ¶
type OpenMeteoResponseSpec struct { // Geographical WGS84 coordinate of the location Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` GenerationTimeMs float64 `json:"generationtime_ms"` UTCOffsetSeconds float64 `json:"utc_offset_seconds"` Timezone string `json:"timezone"` TimezoneAbbreviation string `json:"timezone_abbreviation"` Elevation float64 `json:"elevation"` HourlyUnits HourlyUnitsSpec `json:"hourly_units"` Hourly HourlySpec `json:"hourly"` }
OpenMeteoResponseSpec represents the fields available to be sent to Open Meteo. DISCLAIMER: NOT all the fields are covered. Only those that are considered useful to know if it's hot Ref: https://open-meteo.com/en/docs
func GetApiData ¶
func GetApiData(ctx *v1alpha1.Context) (response *OpenMeteoResponseSpec, err error)
GetApiData TODO
Click to show internal directories.
Click to hide internal directories.