Dagger
Search

OpenWeatherApi

No long description provided.

Installation

dagger install github.com/pjmagee/dagger-openweatherapi@1217a87218b3b11e867954cbebc1332fcdf4f688

Entrypoint

Return Type
OpenWeatherApi !
Arguments
NameTypeDefault ValueDescription
apiKeySecret !-The apiKey to use for the OpenWeatherMap API
unitString !"C"The unit to use (C, F, or K)
langString !"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
NameTypeDefault ValueDescription
latString !-The latitude
lonString !-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
NameTypeDefault ValueDescription
nameString !-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