open-weather-api
No long description provided.
Installation
dagger install github.com/pjmagee/daggerverse/open-weather-api@daa6feeb6e7b599b6ac5ae202e989fd296212c95Entrypoint
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/daggerverse/open-weather-api@daa6feeb6e7b599b6ac5ae202e989fd296212c95 call \
--api-key env:MYSECRET --unit string --lang stringfunc (m *MyModule) Example(apiKey *dagger.Secret, unit string, lang string) *dagger.OpenWeatherApi {
return dag.
OpenWeatherApi(apiKey, unit, lang)
}@function
def example(api_key: dagger.Secret, unit: str, lang: str) -> dagger.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/daggerverse/open-weather-api@daa6feeb6e7b599b6ac5ae202e989fd296212c95 call \
--api-key env:MYSECRET --unit string --lang string api-keyfunc (m *MyModule) Example(apiKey *dagger.Secret, unit string, lang string) *dagger.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/daggerverse/open-weather-api@daa6feeb6e7b599b6ac5ae202e989fd296212c95 call \
--api-key env:MYSECRET --unit string --lang string unitfunc (m *MyModule) Example(ctx context.Context, apiKey *dagger.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/daggerverse/open-weather-api@daa6feeb6e7b599b6ac5ae202e989fd296212c95 call \
--api-key env:MYSECRET --unit string --lang string langfunc (m *MyModule) Example(ctx context.Context, apiKey *dagger.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
OpenWeatherApiWeather ! Example
dagger -m github.com/pjmagee/daggerverse/open-weather-api@daa6feeb6e7b599b6ac5ae202e989fd296212c95 call \
--api-key env:MYSECRET --unit string --lang string resultfunc (m *MyModule) Example(apiKey *dagger.Secret, unit string, lang string) *dagger.OpenWeatherApiWeather {
return dag.
OpenWeatherApi(apiKey, unit, lang).
Result()
}@function
def example(api_key: dagger.Secret, unit: str, lang: str) -> dagger.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/daggerverse/open-weather-api@daa6feeb6e7b599b6ac5ae202e989fd296212c95 call \
--api-key env:MYSECRET --unit string --lang string fieldsfunc (m *MyModule) Example(ctx context.Context, apiKey *dagger.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/daggerverse/open-weather-api@daa6feeb6e7b599b6ac5ae202e989fd296212c95 call \
--api-key env:MYSECRET --unit string --lang string with-fields --fields string1 --fields string2func (m *MyModule) Example(apiKey *dagger.Secret, unit string, lang string, fields []string) *dagger.OpenWeatherApi {
return dag.
OpenWeatherApi(apiKey, unit, lang).
WithFields(fields)
}@function
def example(api_key: dagger.Secret, unit: str, lang: str, fields: List[str]) -> dagger.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/daggerverse/open-weather-api@daa6feeb6e7b599b6ac5ae202e989fd296212c95 call \
--api-key env:MYSECRET --unit string --lang string as-stringfunc (m *MyModule) Example(ctx context.Context, apiKey *dagger.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/daggerverse/open-weather-api@daa6feeb6e7b599b6ac5ae202e989fd296212c95 call \
--api-key env:MYSECRET --unit string --lang string as-jsonfunc (m *MyModule) Example(apiKey *dagger.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/daggerverse/open-weather-api@daa6feeb6e7b599b6ac5ae202e989fd296212c95 call \
--api-key env:MYSECRET --unit string --lang string use-coordinates --lat string --lon stringfunc (m *MyModule) Example(apiKey *dagger.Secret, unit string, lang string, lat string, lon string) *dagger.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) -> dagger.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/daggerverse/open-weather-api@daa6feeb6e7b599b6ac5ae202e989fd296212c95 call \
--api-key env:MYSECRET --unit string --lang string use-location --name stringfunc (m *MyModule) Example(apiKey *dagger.Secret, unit string, lang string, name string) *dagger.OpenWeatherApi {
return dag.
OpenWeatherApi(apiKey, unit, lang).
UseLocation(name)
}@function
def example(api_key: dagger.Secret, unit: str, lang: str, name: str) -> dagger.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)
}OpenWeatherApiWeather 🔗
temp() 🔗
The temperature in the requested unit
Return Type
String ! Example
Function OpenWeatherApiWeather.temp is not accessible from the open-weather-api moduleFunction OpenWeatherApiWeather.temp is not accessible from the open-weather-api moduleFunction OpenWeatherApiWeather.temp is not accessible from the open-weather-api moduleFunction OpenWeatherApiWeather.temp is not accessible from the open-weather-api moduleunit() 🔗
The unit of the temperature (C, F, or K)
Return Type
String ! Example
Function OpenWeatherApiWeather.unit is not accessible from the open-weather-api moduleFunction OpenWeatherApiWeather.unit is not accessible from the open-weather-api moduleFunction OpenWeatherApiWeather.unit is not accessible from the open-weather-api moduleFunction OpenWeatherApiWeather.unit is not accessible from the open-weather-api moduledescription() 🔗
The description of the weather (e.g. “clear sky”, “light rain”, etc.)
Return Type
String ! Example
Function OpenWeatherApiWeather.description is not accessible from the open-weather-api moduleFunction OpenWeatherApiWeather.description is not accessible from the open-weather-api moduleFunction OpenWeatherApiWeather.description is not accessible from the open-weather-api moduleFunction OpenWeatherApiWeather.description is not accessible from the open-weather-api modulefeelsLike() 🔗
The “feels like” temperature in the requested unit
Return Type
String ! Example
Function OpenWeatherApiWeather.feelsLike is not accessible from the open-weather-api moduleFunction OpenWeatherApiWeather.feelsLike is not accessible from the open-weather-api moduleFunction OpenWeatherApiWeather.feelsLike is not accessible from the open-weather-api moduleFunction OpenWeatherApiWeather.feelsLike is not accessible from the open-weather-api modulesummary() 🔗
The summary of the weather (e.g. “London, clear sky, 20°C (🌤️)”)
Return Type
String ! Example
Function OpenWeatherApiWeather.summary is not accessible from the open-weather-api moduleFunction OpenWeatherApiWeather.summary is not accessible from the open-weather-api moduleFunction OpenWeatherApiWeather.summary is not accessible from the open-weather-api moduleFunction OpenWeatherApiWeather.summary is not accessible from the open-weather-api moduleicon() 🔗
The icon to use for the weather (e.g. “🌤️”)
Return Type
String ! Example
Function OpenWeatherApiWeather.icon is not accessible from the open-weather-api moduleFunction OpenWeatherApiWeather.icon is not accessible from the open-weather-api moduleFunction OpenWeatherApiWeather.icon is not accessible from the open-weather-api moduleFunction OpenWeatherApiWeather.icon is not accessible from the open-weather-api module