OpenWeatherApi
No long description provided.
Installation
dagger install github.com/pjmagee/dagger-openweatherapi@1217a87218b3b11e867954cbebc1332fcdf4f688
Entrypoint
Return Type
OpenWeatherApi !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
apiKey | Secret ! | - | The apiKey to use for the OpenWeatherMap API |
unit | String ! | "C" | The unit to use (C, F, or K) |
lang | String ! | "en" | The 2-letter ISO code for the language to use (en, es, etc.) |
Example
func (m *myModule) example(apiKey *Secret, unit string, lang string) *OpenWeatherApi {
return dag.
OpenWeatherApi(apiKey, unit, lang)
}
Types
OpenWeatherApi π
apiKey() π
The apiKey to use for the OpenWeatherMap API
Return Type
Secret !
Example
func (m *myModule) example(apiKey *Secret, unit string, lang string) *Secret {
return dag.
OpenWeatherApi(apiKey, unit, lang).
ApiKey()
}
unit() π
The unit to use (C, F, or K)
Return Type
String !
Example
func (m *myModule) example(ctx context.Context, apiKey *Secret, unit string, lang string) string {
return dag.
OpenWeatherApi(apiKey, unit, lang).
Unit(ctx)
}
lang() π
The 2-letter ISO code for the language to use (en, es, etc.)
Return Type
String !
Example
func (m *myModule) example(ctx context.Context, apiKey *Secret, unit string, lang string) string {
return dag.
OpenWeatherApi(apiKey, unit, lang).
Lang(ctx)
}
result() π
The weather data returned by the API call
Return Type
Weather !
Example
func (m *myModule) example(apiKey *Secret, unit string, lang string) *OpenWeatherApiWeather {
return dag.
OpenWeatherApi(apiKey, unit, lang).
Result()
}
asJson() π
returns the weather data as a JSON string
Return Type
Scalar !
Example
func (m *myModule) example(apiKey *Secret, unit string, lang string) {
return dag.
OpenWeatherApi(apiKey, unit, lang).
AsJson()
}
useCoordinates() π
retrieves the current weather for the given latitude and longitude
Return Type
OpenWeatherApi !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
lat | String ! | - | The latitude |
lon | String ! | - | The longitude |
Example
func (m *myModule) example(apiKey *Secret, unit string, lang string, lat string, lon string) *OpenWeatherApi {
return dag.
OpenWeatherApi(apiKey, unit, lang).
UseCoordinates(lat, lon)
}
useLocation() π
retrieves the current weather for the given location name
Return Type
OpenWeatherApi !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
name | String ! | - | The name of the location (e,g "London,UK", "New York,US", "Tokyo,JP", "Sydney,AU") |
Example
func (m *myModule) example(apiKey *Secret, unit string, lang string, name string) *OpenWeatherApi {
return dag.
OpenWeatherApi(apiKey, unit, lang).
UseLocation(name)
}
Weather π
temp() π
The temperature in the requested unit
Return Type
String !
Example
Function OpenWeatherApiWeather.temp is not accessible from the OpenWeatherApi module
unit() π
The unit of the temperature (C, F, or K)
Return Type
String !
Example
Function OpenWeatherApiWeather.unit is not accessible from the OpenWeatherApi module
description() π
The description of the weather (e.g. βclear skyβ, βlight rainβ, etc.)
Return Type
String !
Example
Function OpenWeatherApiWeather.description is not accessible from the OpenWeatherApi module
feelsLike() π
The βfeels likeβ temperature in the requested unit
Return Type
String !
Example
Function OpenWeatherApiWeather.feelsLike is not accessible from the OpenWeatherApi module
summary() π
The summary of the weather (e.g. βLondon, clear sky, 20Β°C (π€οΈ)β)
Return Type
String !
Example
Function OpenWeatherApiWeather.summary is not accessible from the OpenWeatherApi module
icon() π
The icon to use for the weather (e.g. βπ€οΈβ)
Return Type
String !
Example
Function OpenWeatherApiWeather.icon is not accessible from the OpenWeatherApi module