OpenWeatherApi
No long description provided.
Installation
dagger install github.com/pjmagee/dagger-openweatherapi@71ff453eb5ead41dbca7546bd94f3fa7fdba2b43
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
dagger -m github.com/pjmagee/dagger-openweatherapi@71ff453eb5ead41dbca7546bd94f3fa7fdba2b43 call \
--api-key env:MYSECRET --unit string --lang string
func (m *myModule) example(apiKey *Secret, unit string, lang string) *OpenWeatherApi {
return dag.
OpenWeatherApi(apiKey, unit, lang)
}
@function
def example(api_key: dagger.Secret, unit: str, lang: str) -> dag.OpenWeatherApi:
return (
dag.open_weather_api(api_key, unit, lang)
)
@func()
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
dagger -m github.com/pjmagee/dagger-openweatherapi@71ff453eb5ead41dbca7546bd94f3fa7fdba2b43 call \
--api-key env:MYSECRET --unit string --lang string api-key
func (m *myModule) example(apiKey *Secret, unit string, lang string) *Secret {
return dag.
OpenWeatherApi(apiKey, unit, lang).
ApiKey()
}
@function
def example(api_key: dagger.Secret, unit: str, lang: str) -> dagger.Secret:
return (
dag.open_weather_api(api_key, unit, lang)
.api_key()
)
@func()
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
dagger -m github.com/pjmagee/dagger-openweatherapi@71ff453eb5ead41dbca7546bd94f3fa7fdba2b43 call \
--api-key env:MYSECRET --unit string --lang string unit
func (m *myModule) example(ctx context.Context, apiKey *Secret, unit string, lang string) string {
return dag.
OpenWeatherApi(apiKey, unit, lang).
Unit(ctx)
}
@function
async def example(api_key: dagger.Secret, unit: str, lang: str) -> str:
return await (
dag.open_weather_api(api_key, unit, lang)
.unit()
)
@func()
async example(apiKey: Secret, unit: string, lang: string): Promise<string> {
return dag
.openWeatherApi(apiKey, unit, lang)
.unit()
}
lang() 🔗
The 2-letter ISO code for the language to use (en, es, etc.)
Return Type
String !
Example
dagger -m github.com/pjmagee/dagger-openweatherapi@71ff453eb5ead41dbca7546bd94f3fa7fdba2b43 call \
--api-key env:MYSECRET --unit string --lang string lang
func (m *myModule) example(ctx context.Context, apiKey *Secret, unit string, lang string) string {
return dag.
OpenWeatherApi(apiKey, unit, lang).
Lang(ctx)
}
@function
async def example(api_key: dagger.Secret, unit: str, lang: str) -> str:
return await (
dag.open_weather_api(api_key, unit, lang)
.lang()
)
@func()
async example(apiKey: Secret, unit: string, lang: string): Promise<string> {
return dag
.openWeatherApi(apiKey, unit, lang)
.lang()
}
result() 🔗
The weather data returned by the API call
Return Type
Weather !
Example
dagger -m github.com/pjmagee/dagger-openweatherapi@71ff453eb5ead41dbca7546bd94f3fa7fdba2b43 call \
--api-key env:MYSECRET --unit string --lang string result
func (m *myModule) example(apiKey *Secret, unit string, lang string) *OpenWeatherApiWeather {
return dag.
OpenWeatherApi(apiKey, unit, lang).
Result()
}
@function
def example(api_key: dagger.Secret, unit: str, lang: str) -> dag.OpenWeatherApiWeather:
return (
dag.open_weather_api(api_key, unit, lang)
.result()
)
@func()
example(apiKey: Secret, unit: string, lang: string): OpenWeatherApiWeather {
return dag
.openWeatherApi(apiKey, unit, lang)
.result()
}
fields() 🔗
The elements to include in the JSON response
Return Type
[String ! ] !
Example
dagger -m github.com/pjmagee/dagger-openweatherapi@71ff453eb5ead41dbca7546bd94f3fa7fdba2b43 call \
--api-key env:MYSECRET --unit string --lang string fields
func (m *myModule) example(ctx context.Context, apiKey *Secret, unit string, lang string) []string {
return dag.
OpenWeatherApi(apiKey, unit, lang).
Fields(ctx)
}
@function
async def example(api_key: dagger.Secret, unit: str, lang: str) -> List[str]:
return await (
dag.open_weather_api(api_key, unit, lang)
.fields()
)
@func()
async example(apiKey: Secret, unit: string, lang: string): Promise<string[]> {
return dag
.openWeatherApi(apiKey, unit, lang)
.fields()
}
withFields() 🔗
the fields to include in the response when returning a formatted response
Return Type
OpenWeatherApi !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
fields | [String ! ] ! | - | The fields to include in the response |
Example
dagger -m github.com/pjmagee/dagger-openweatherapi@71ff453eb5ead41dbca7546bd94f3fa7fdba2b43 call \
--api-key env:MYSECRET --unit string --lang string with-fields --fields string1 --fields string2
func (m *myModule) example(apiKey *Secret, unit string, lang string, fields []string) *OpenWeatherApi {
return dag.
OpenWeatherApi(apiKey, unit, lang).
WithFields(fields)
}
@function
def example(api_key: dagger.Secret, unit: str, lang: str, fields: List[str]) -> dag.OpenWeatherApi:
return (
dag.open_weather_api(api_key, unit, lang)
.with_fields(fields)
)
@func()
example(apiKey: Secret, unit: string, lang: string, fields: string[]): OpenWeatherApi {
return dag
.openWeatherApi(apiKey, unit, lang)
.withFields(fields)
}
asString() 🔗
returns the weather data as a string, formatted according to the fields provided
Return Type
String !
Example
dagger -m github.com/pjmagee/dagger-openweatherapi@71ff453eb5ead41dbca7546bd94f3fa7fdba2b43 call \
--api-key env:MYSECRET --unit string --lang string as-string
func (m *myModule) example(ctx context.Context, apiKey *Secret, unit string, lang string) string {
return dag.
OpenWeatherApi(apiKey, unit, lang).
AsString(ctx)
}
@function
async def example(api_key: dagger.Secret, unit: str, lang: str) -> str:
return await (
dag.open_weather_api(api_key, unit, lang)
.as_string()
)
@func()
async example(apiKey: Secret, unit: string, lang: string): Promise<string> {
return dag
.openWeatherApi(apiKey, unit, lang)
.asString()
}
asJson() 🔗
returns the weather data as a JSON string, formatted according to the fields provided
Return Type
Scalar !
Example
dagger -m github.com/pjmagee/dagger-openweatherapi@71ff453eb5ead41dbca7546bd94f3fa7fdba2b43 call \
--api-key env:MYSECRET --unit string --lang string as-json
func (m *myModule) example(apiKey *Secret, unit string, lang string) {
return dag.
OpenWeatherApi(apiKey, unit, lang).
AsJson()
}
@function
def example(api_key: dagger.Secret, unit: str, lang: str) -> :
return (
dag.open_weather_api(api_key, unit, lang)
.as_json()
)
@func()
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
dagger -m github.com/pjmagee/dagger-openweatherapi@71ff453eb5ead41dbca7546bd94f3fa7fdba2b43 call \
--api-key env:MYSECRET --unit string --lang string use-coordinates --lat string --lon string
func (m *myModule) example(apiKey *Secret, unit string, lang string, lat string, lon string) *OpenWeatherApi {
return dag.
OpenWeatherApi(apiKey, unit, lang).
UseCoordinates(lat, lon)
}
@function
def example(api_key: dagger.Secret, unit: str, lang: str, lat: str, lon: str) -> dag.OpenWeatherApi:
return (
dag.open_weather_api(api_key, unit, lang)
.use_coordinates(lat, lon)
)
@func()
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
dagger -m github.com/pjmagee/dagger-openweatherapi@71ff453eb5ead41dbca7546bd94f3fa7fdba2b43 call \
--api-key env:MYSECRET --unit string --lang string use-location --name string
func (m *myModule) example(apiKey *Secret, unit string, lang string, name string) *OpenWeatherApi {
return dag.
OpenWeatherApi(apiKey, unit, lang).
UseLocation(name)
}
@function
def example(api_key: dagger.Secret, unit: str, lang: str, name: str) -> dag.OpenWeatherApi:
return (
dag.open_weather_api(api_key, unit, lang)
.use_location(name)
)
@func()
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
Function OpenWeatherApiWeather.temp is not accessible from the OpenWeatherApi module
Function OpenWeatherApiWeather.temp is not accessible from the OpenWeatherApi module
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
Function OpenWeatherApiWeather.unit is not accessible from the OpenWeatherApi module
Function OpenWeatherApiWeather.unit is not accessible from the OpenWeatherApi module
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
Function OpenWeatherApiWeather.description is not accessible from the OpenWeatherApi module
Function OpenWeatherApiWeather.description is not accessible from the OpenWeatherApi module
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
Function OpenWeatherApiWeather.feelsLike is not accessible from the OpenWeatherApi module
Function OpenWeatherApiWeather.feelsLike is not accessible from the OpenWeatherApi module
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
Function OpenWeatherApiWeather.summary is not accessible from the OpenWeatherApi module
Function OpenWeatherApiWeather.summary is not accessible from the OpenWeatherApi module
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
Function OpenWeatherApiWeather.icon is not accessible from the OpenWeatherApi module
Function OpenWeatherApiWeather.icon is not accessible from the OpenWeatherApi module
Function OpenWeatherApiWeather.icon is not accessible from the OpenWeatherApi module