Documentation
¶
Index ¶
- Constants
- Variables
- func ExhaustiveLangs(f func(Lang))
- func ExhaustiveParts(f func(Part))
- func ExhaustiveUnits(f func(Unit))
- func ExhaustiveWeatherConditions(f func(WeatherCondition))
- type Client
- type ClientOptions
- type CurrentResponse
- type CurrentResponseRaw
- type DailyResponse
- type DailyResponseRaw
- type FeelsLike
- type HourlyResponse
- type HourlyResponseRaw
- type Lang
- func (l Lang) IsValid() bool
- func (l Lang) MarshalBinary() ([]byte, error)
- func (l Lang) MarshalJSON() ([]byte, error)
- func (l Lang) MarshalText() ([]byte, error)
- func (l Lang) MarshalYAML() ([]byte, error)
- func (l *Lang) Scan(value any) error
- func (l Lang) String() string
- func (l *Lang) UnmarshalBinary(b []byte) error
- func (l *Lang) UnmarshalJSON(b []byte) error
- func (l *Lang) UnmarshalText(b []byte) error
- func (l *Lang) UnmarshalYAML(b []byte) error
- func (l Lang) Value() (driver.Value, error)
- type MinuteResponse
- type MinuteResponseRaw
- type OneCallOptions
- type OneCallResponse
- type OneCallResponseRaw
- type Part
- func (p Part) IsValid() bool
- func (p Part) MarshalBinary() ([]byte, error)
- func (p Part) MarshalJSON() ([]byte, error)
- func (p Part) MarshalText() ([]byte, error)
- func (p Part) MarshalYAML() ([]byte, error)
- func (p *Part) Scan(value any) error
- func (p Part) String() string
- func (p *Part) UnmarshalBinary(b []byte) error
- func (p *Part) UnmarshalJSON(b []byte) error
- func (p *Part) UnmarshalText(b []byte) error
- func (p *Part) UnmarshalYAML(b []byte) error
- func (p Part) Value() (driver.Value, error)
- type PartList
- type RainRaw
- type SnowRaw
- type Temp
- type Unit
- func (u Unit) IsValid() bool
- func (u Unit) MarshalBinary() ([]byte, error)
- func (u Unit) MarshalJSON() ([]byte, error)
- func (u Unit) MarshalText() ([]byte, error)
- func (u Unit) MarshalYAML() ([]byte, error)
- func (u *Unit) Scan(value any) error
- func (u Unit) String() string
- func (u *Unit) UnmarshalBinary(b []byte) error
- func (u *Unit) UnmarshalJSON(b []byte) error
- func (u *Unit) UnmarshalText(b []byte) error
- func (u *Unit) UnmarshalYAML(b []byte) error
- func (u Unit) Value() (driver.Value, error)
- type Weather
- type WeatherCondition
- func (w WeatherCondition) IsValid() bool
- func (w WeatherCondition) MarshalBinary() ([]byte, error)
- func (w WeatherCondition) MarshalJSON() ([]byte, error)
- func (w WeatherCondition) MarshalText() ([]byte, error)
- func (w WeatherCondition) MarshalYAML() ([]byte, error)
- func (w *WeatherCondition) Scan(value any) error
- func (w WeatherCondition) String() string
- func (w *WeatherCondition) UnmarshalBinary(b []byte) error
- func (w *WeatherCondition) UnmarshalJSON(b []byte) error
- func (w *WeatherCondition) UnmarshalText(b []byte) error
- func (w *WeatherCondition) UnmarshalYAML(b []byte) error
- func (w WeatherCondition) Value() (driver.Value, error)
- type WeatherRaw
Constants ¶
const ( Albanian lang // sq Afrikaans // af Arabic // ar Azerbaijani // az Basque // eu Belarusian // be Bulgarian // bg Catalan // ca ChineseSimplified // zh_cn ChineseTraditional // zh_tw Croatian // hr Czech // cz Danish // da Dutch // nl English // en Finnish // fi French // fr Galician // gl German // de Greek // el Hebrew // he Hindi // hi Hungarian // hu Icelandic // is Indonesian // id Italian // it Japanese // ja Korean // kr Kurmanji // ku Latvian // la Lithuanian // lt Macedonian // mk Norwegian // no Persian // fa Polish // pl Portuguese // pt PortugueseBrazil // pt_br Romanian // ro Russian // ru Serbian // sr Slovak // sk Slovenian // sl Spanish // sp Swedish // sv Thai // th Turkish // tr Ukrainian // ua Vietnamese // vi Zulu // zu )
Variables ¶
var Langs = langsContainer{ UNKNOWNLANG: Lang{ // contains filtered or unexported fields }, ALBANIAN: Lang{ // contains filtered or unexported fields }, AFRIKAANS: Lang{ // contains filtered or unexported fields }, ARABIC: Lang{ // contains filtered or unexported fields }, AZERBAIJANI: Lang{ // contains filtered or unexported fields }, BASQUE: Lang{ // contains filtered or unexported fields }, BELARUSIAN: Lang{ // contains filtered or unexported fields }, BULGARIAN: Lang{ // contains filtered or unexported fields }, CATALAN: Lang{ // contains filtered or unexported fields }, CHINESESIMPLIFIED: Lang{ // contains filtered or unexported fields }, CHINESETRADITIONAL: Lang{ // contains filtered or unexported fields }, CROATIAN: Lang{ // contains filtered or unexported fields }, CZECH: Lang{ // contains filtered or unexported fields }, DANISH: Lang{ // contains filtered or unexported fields }, DUTCH: Lang{ // contains filtered or unexported fields }, ENGLISH: Lang{ // contains filtered or unexported fields }, FINNISH: Lang{ // contains filtered or unexported fields }, FRENCH: Lang{ // contains filtered or unexported fields }, GALICIAN: Lang{ // contains filtered or unexported fields }, GERMAN: Lang{ // contains filtered or unexported fields }, GREEK: Lang{ // contains filtered or unexported fields }, HEBREW: Lang{ // contains filtered or unexported fields }, HINDI: Lang{ // contains filtered or unexported fields }, HUNGARIAN: Lang{ // contains filtered or unexported fields }, ICELANDIC: Lang{ // contains filtered or unexported fields }, INDONESIAN: Lang{ // contains filtered or unexported fields }, ITALIAN: Lang{ // contains filtered or unexported fields }, JAPANESE: Lang{ // contains filtered or unexported fields }, KOREAN: Lang{ // contains filtered or unexported fields }, KURMANJI: Lang{ // contains filtered or unexported fields }, LATVIAN: Lang{ // contains filtered or unexported fields }, LITHUANIAN: Lang{ // contains filtered or unexported fields }, MACEDONIAN: Lang{ // contains filtered or unexported fields }, NORWEGIAN: Lang{ // contains filtered or unexported fields }, PERSIAN: Lang{ // contains filtered or unexported fields }, POLISH: Lang{ // contains filtered or unexported fields }, PORTUGUESE: Lang{ // contains filtered or unexported fields }, PORTUGUESEBRAZIL: Lang{ // contains filtered or unexported fields }, ROMANIAN: Lang{ // contains filtered or unexported fields }, RUSSIAN: Lang{ // contains filtered or unexported fields }, SERBIAN: Lang{ // contains filtered or unexported fields }, SLOVAK: Lang{ // contains filtered or unexported fields }, SLOVENIAN: Lang{ // contains filtered or unexported fields }, SPANISH: Lang{ // contains filtered or unexported fields }, SWEDISH: Lang{ // contains filtered or unexported fields }, THAI: Lang{ // contains filtered or unexported fields }, TURKISH: Lang{ // contains filtered or unexported fields }, UKRAINIAN: Lang{ // contains filtered or unexported fields }, VIETNAMESE: Lang{ // contains filtered or unexported fields }, ZULU: Lang{ // contains filtered or unexported fields }, }
Langs is a main entry point using the Lang type. It it a container for all enum values and provides a convenient way to access all enum values and perform operations, with convenience methods for common use cases.
var Parts = partsContainer{ UNKNOWNPART: Part{ // contains filtered or unexported fields }, CURRENT: Part{ // contains filtered or unexported fields }, MINUTELY: Part{ // contains filtered or unexported fields }, HOURLY: Part{ // contains filtered or unexported fields }, DAILY: Part{ // contains filtered or unexported fields }, ALERTS: Part{ // contains filtered or unexported fields }, }
Parts is a main entry point using the Part type. It it a container for all enum values and provides a convenient way to access all enum values and perform operations, with convenience methods for common use cases.
var Units = unitsContainer{ UNKNOWNUNIT: Unit{ // contains filtered or unexported fields }, STANDARD: Unit{ // contains filtered or unexported fields }, METRIC: Unit{ // contains filtered or unexported fields }, IMPERIAL: Unit{ // contains filtered or unexported fields }, }
Units is a main entry point using the Unit type. It it a container for all enum values and provides a convenient way to access all enum values and perform operations, with convenience methods for common use cases.
var WeatherConditions = weatherConditionsContainer{ THUNDERSTORMWITHLIGHTRAIN: WeatherCondition{ Code: 200, Group: "Thunderstorm", Description: "thunderstorm with light rain", // contains filtered or unexported fields }, THUNDERSTORMWITHRAIN: WeatherCondition{ Code: 201, Group: "Thunderstorm", Description: "thunderstorm with rain", // contains filtered or unexported fields }, THUNDERSTORMWITHHEAVYRAIN: WeatherCondition{ Code: 202, Group: "Thunderstorm", Description: "thunderstorm with heavy rain", // contains filtered or unexported fields }, LIGHTTHUNDERSTORM: WeatherCondition{ Code: 210, Group: "Thunderstorm", Description: "light thunderstorm", // contains filtered or unexported fields }, THUNDERSTORM: WeatherCondition{ Code: 211, Group: "Thunderstorm", Description: "thunderstorm", // contains filtered or unexported fields }, HEAVYTHUNDERSTORM: WeatherCondition{ Code: 212, Group: "Thunderstorm", Description: "heavy thunderstorm", // contains filtered or unexported fields }, RAGGEDTHUNDERSTORM: WeatherCondition{ Code: 221, Group: "Thunderstorm", Description: "ragged thunderstorm", // contains filtered or unexported fields }, THUNDERSTORMWITHLIGHTDRIZZLE: WeatherCondition{ Code: 230, Group: "Thunderstorm", Description: "thunderstorm with light drizzle", // contains filtered or unexported fields }, THUNDERSTORMWITHDRIZZLE: WeatherCondition{ Code: 231, Group: "Thunderstorm", Description: "thunderstorm with drizzle", // contains filtered or unexported fields }, THUNDERSTORMWITHHEAVYDRIZZLE: WeatherCondition{ Code: 232, Group: "Thunderstorm", Description: "thunderstorm with drizzle", // contains filtered or unexported fields }, LIGHTINTENSITYDRIZZLE: WeatherCondition{ Code: 300, Group: "Drizzle", Description: "light intensity drizzle", // contains filtered or unexported fields }, DRIZZLE: WeatherCondition{ Code: 301, Group: "Drizzle", Description: "drizzle", // contains filtered or unexported fields }, HEAVYINTENSITYDRIZZLE: WeatherCondition{ Code: 310, Group: "Drizzle", Description: "heavy intensity drizzle", // contains filtered or unexported fields }, LIGHTINTENSITYDRIZZLERAIN: WeatherCondition{ Code: 311, Group: "Drizzle", Description: "light intensity drizzle rain", // contains filtered or unexported fields }, DRIZZLERAIN: WeatherCondition{ Code: 312, Group: "Drizzle", Description: "drizzle rain", // contains filtered or unexported fields }, SHOWERRAINANDDRIZZLE: WeatherCondition{ Code: 313, Group: "Drizzle", Description: "shower rain and drizzle", // contains filtered or unexported fields }, HEAVYSHOWERRAINANDDRIZZLE: WeatherCondition{ Code: 314, Group: "Drizzle", Description: "heavy shower rain and drizzle", // contains filtered or unexported fields }, SHOWERDRIZZLE: WeatherCondition{ Code: 321, Group: "Drizzle", Description: "shower drizzle", // contains filtered or unexported fields }, LIGHTRAIN: WeatherCondition{ Code: 500, Group: "Rain", Description: "light rain", // contains filtered or unexported fields }, MODERATERAIN: WeatherCondition{ Code: 501, Group: "Rain", Description: "moderate rain", // contains filtered or unexported fields }, HEAVYINTENSITYRAIN: WeatherCondition{ Code: 502, Group: "Rain", Description: "heavy intensity rain", // contains filtered or unexported fields }, VERYHEAVYRAIN: WeatherCondition{ Code: 503, Group: "Rain", Description: "very heavy rain", // contains filtered or unexported fields }, EXTREMERAIN: WeatherCondition{ Code: 504, Group: "Rain", Description: "extreme rain", // contains filtered or unexported fields }, FREEZINGRAIN: WeatherCondition{ Code: 511, Group: "Rain", Description: "freezing rain", // contains filtered or unexported fields }, LIGHTINTENSITYSHOWERRAIN: WeatherCondition{ Code: 520, Group: "Rain", Description: "light intensity shower rain", // contains filtered or unexported fields }, SHOWERRAIN: WeatherCondition{ Code: 521, Group: "Rain", Description: "shower rain", // contains filtered or unexported fields }, HEAVYINTENSITYSHOWERRAIN: WeatherCondition{ Code: 522, Group: "Rain", Description: "heavy intensity shower rain", // contains filtered or unexported fields }, RAGGEDSHOWERRAIN: WeatherCondition{ Code: 531, Group: "Rain", Description: "ragged shower rain", // contains filtered or unexported fields }, LIGHTSNOW: WeatherCondition{ Code: 600, Group: "Snow", Description: "light snow", // contains filtered or unexported fields }, SNOW: WeatherCondition{ Code: 601, Group: "Snow", Description: "snow", // contains filtered or unexported fields }, HEAVYSNOW: WeatherCondition{ Code: 602, Group: "Snow", Description: "heavy snow", // contains filtered or unexported fields }, SLEET: WeatherCondition{ Code: 611, Group: "Snow", Description: "sleet", // contains filtered or unexported fields }, LIGHTSHOWERSLEET: WeatherCondition{ Code: 612, Group: "Snow", Description: "light shower sleet", // contains filtered or unexported fields }, SHOWERSLEET: WeatherCondition{ Code: 613, Group: "Snow", Description: "shower sleet", // contains filtered or unexported fields }, LIGHTRAINANDSNOW: WeatherCondition{ Code: 615, Group: "Snow", Description: "light rain and snow", // contains filtered or unexported fields }, RAINANDSNOW: WeatherCondition{ Code: 616, Group: "Snow", Description: "rain and snow", // contains filtered or unexported fields }, LIGHTSHOWERSNOW: WeatherCondition{ Code: 620, Group: "Snow", Description: "light shower snow", // contains filtered or unexported fields }, SHOWERSNOW: WeatherCondition{ Code: 621, Group: "Snow", Description: "shower snow", // contains filtered or unexported fields }, HEAVYSHOWERSNOW: WeatherCondition{ Code: 622, Group: "Snow", Description: "heavy shower snow", // contains filtered or unexported fields }, MIST: WeatherCondition{ Code: 701, Group: "Mist", Description: "mist", // contains filtered or unexported fields }, SMOKE: WeatherCondition{ Code: 711, Group: "Smoke", Description: "smoke", // contains filtered or unexported fields }, HAZE: WeatherCondition{ Code: 721, Group: "Haze", Description: "haze", // contains filtered or unexported fields }, SANDDUSTWHIRLS: WeatherCondition{ Code: 731, Group: "Dust", Description: "sand/dust whirls", // contains filtered or unexported fields }, FOG: WeatherCondition{ Code: 741, Group: "Fog", Description: "fog", // contains filtered or unexported fields }, SAND: WeatherCondition{ Code: 751, Group: "Sand", Description: "sand", // contains filtered or unexported fields }, DUST: WeatherCondition{ Code: 761, Group: "Dust", Description: "dust", // contains filtered or unexported fields }, VOLCANICASH: WeatherCondition{ Code: 762, Group: "Ash", Description: "volcanic ash", // contains filtered or unexported fields }, SQUALLS: WeatherCondition{ Code: 771, Group: "Squall", Description: "squalls", // contains filtered or unexported fields }, TORNADO: WeatherCondition{ Code: 781, Group: "Tornado", Description: "tornado", // contains filtered or unexported fields }, CLEAR: WeatherCondition{ Code: 800, Group: "Clear", Description: "clear sky", // contains filtered or unexported fields }, FEWCLOUDS: WeatherCondition{ Code: 801, Group: "Clouds", Description: "few clouds", // contains filtered or unexported fields }, SCATTEREDCLOUDS: WeatherCondition{ Code: 802, Group: "Clouds", Description: "scattered clouds", // contains filtered or unexported fields }, BROKENCLOUDS: WeatherCondition{ Code: 803, Group: "Clouds", Description: "broken clouds", // contains filtered or unexported fields }, OVERCASTCLOUDS: WeatherCondition{ Code: 804, Group: "Clouds", Description: "overcast clouds", // contains filtered or unexported fields }, }
WeatherConditions is a main entry point using the WeatherCondition type. It it a container for all enum values and provides a convenient way to access all enum values and perform operations, with convenience methods for common use cases.
Functions ¶
func ExhaustiveLangs ¶
func ExhaustiveLangs(f func(Lang))
ExhaustiveLangs iterates over all enum values and calls the provided function for each value. This function is useful for performing operations on all valid enum values in a loop.
func ExhaustiveParts ¶ added in v0.2.0
func ExhaustiveParts(f func(Part))
ExhaustiveParts iterates over all enum values and calls the provided function for each value. This function is useful for performing operations on all valid enum values in a loop.
func ExhaustiveUnits ¶
func ExhaustiveUnits(f func(Unit))
ExhaustiveUnits iterates over all enum values and calls the provided function for each value. This function is useful for performing operations on all valid enum values in a loop.
func ExhaustiveWeatherConditions ¶
func ExhaustiveWeatherConditions(f func(WeatherCondition))
ExhaustiveWeatherConditions iterates over all enum values and calls the provided function for each value. This function is useful for performing operations on all valid enum values in a loop.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(opts *ClientOptions) *Client
func (*Client) CurrentAndForecast ¶
func (c *Client) CurrentAndForecast(lat, lon float64, opts *OneCallOptions) (*OneCallResponse, error)
func (*Client) CurrentAndForecastRaw ¶
func (c *Client) CurrentAndForecastRaw(lat, lon float64, opts *OneCallOptions) (*OneCallResponseRaw, error)
type ClientOptions ¶
type CurrentResponse ¶
type CurrentResponse struct {
// Current time
Dt time.Time `json:"dt"`
// Sunrise time. For polar areas in midnight sun and polar night periods this parameter is not returned in the response.
// Use time.IsZero() to distinguish if a value was returned or not.
Sunrise time.Time `json:"sunrise"`
// Sunset time. For polar areas in midnight sun and polar night periods this parameter is not returned in the response.
// Use time.IsZero() to distinguish if a value was returned or not.
Sunset time.Time `json:"sunset"`
// (where available) Precipitation volume, mm. Please note that only mm as units of measurement are available for this parameter
Rain1H *float64 `json:"rain1h"`
// (where available) Snow volume, mm. Please note that only mm as units of measurement are available for this parameter
Snow1H *float64 `json:"snow1h"`
Weather []Weather `json:"weather"`
// contains filtered or unexported fields
}
type CurrentResponseRaw ¶
type CurrentResponseRaw struct {
// Current time, Unix, UTC
Dt int64 `json:"dt"`
// Sunrise time, Unix, UTC. For polar areas in midnight sun and polar night periods this parameter is not returned in the response
Sunrise int64 `json:"sunrise"`
// Sunset time, Unix, UTC. For polar areas in midnight sun and polar night periods this parameter is not returned in the response
Sunset int64 `json:"sunset"`
// (where available) Precipitation volume, mm. Please note that only mm as units of measurement are available for this parameter
Rain *RainRaw `json:"rain,omitempty"`
// (where available) Snow volume, mm. Please note that only mm as units of measurement are available for this parameter
Snow *SnowRaw `json:"snow,omitempty"`
Weather []WeatherRaw `json:"weather"`
// contains filtered or unexported fields
}
Current weather data API response
func (*CurrentResponseRaw) Parse ¶
func (c *CurrentResponseRaw) Parse() *CurrentResponse
type DailyResponse ¶
type DailyResponseRaw ¶
type DailyResponseRaw struct {
Dt int64 // Time of the forecasted data, Unix, UTC
Sunrise int64 // Sunrise time, Unix, UTC. For polar areas in midnight sun and polar night periods this parameter is not returned in the response
Sunset int64 // Sunset time, Unix, UTC. For polar areas in midnight sun and polar night periods this parameter is not returned in the response
Moonrise int64 // The time of when the moon rises for this day, Unix, UTC
Moonset int64 // The time of when the moon rises for this day, Unix, UTC
Weather []WeatherRaw
// contains filtered or unexported fields
}
type HourlyResponse ¶ added in v0.2.0
type HourlyResponseRaw ¶ added in v0.2.0
type HourlyResponseRaw struct {
Dt int64 // Time of the forecasted data, Unix, UTC
Rain *RainRaw `json:"rain,omitempty"` // (where available) Precipitation volume, mm. Please note that only mm as units of measurement are available for this parameter
Snow *SnowRaw `json:"snow,omitempty"` // (where available) Snow volume, mm. Please note that only mm as units of measurement are available for this parameter
Weather []WeatherRaw
// contains filtered or unexported fields
}
type Lang ¶
type Lang struct {
// contains filtered or unexported fields
}
Lang is a type that represents a single enum value. It combines the core information about the enum constant and it's defined fields.
func ParseLang ¶
ParseLang parses the input value into an enum value. It returns the parsed enum value or an error if the input is invalid. It is a convenience function that can be used to parse enum values from various input types, such as strings, byte slices, or other enum types.
func (Lang) IsValid ¶
IsValid checks whether the Langs value is valid. A valid value is one that is defined in the original enum and not marked as invalid.
func (Lang) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface for Lang. It returns the binary representation of the enum value as a byte slice.
func (Lang) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for Lang. It returns the JSON representation of the enum value as a byte slice.
func (Lang) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface for Lang. It returns the string representation of the enum value as a byte slice
func (Lang) MarshalYAML ¶
MarshalYAML implements the yaml.Marshaler interface for Lang. It returns the string representation of the enum value.
func (*Lang) Scan ¶
Scan implements the database/sql.Scanner interface for Lang. It parses the string representation of the enum value from the database row. It returns an error if the row does not contain a valid enum value.
func (Lang) String ¶
String implements the Stringer interface. It returns the canonical absolute name of the enum value.
func (*Lang) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface for Lang. It parses the binary representation of the enum value from the byte slice. It returns an error if the byte slice does not contain a valid enum value.
func (*Lang) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for Lang. It parses the JSON representation of the enum value from the byte slice. It returns an error if the input is not a valid JSON representation.
func (*Lang) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface for Lang. It parses the string representation of the enum value from the byte slice. It returns an error if the byte slice does not contain a valid enum value.
func (*Lang) UnmarshalYAML ¶
UnmarshalYAML implements the yaml.Unmarshaler interface for Planet. It parses the byte slice representation of the enum value and returns an error if the YAML byte slice does not contain a valid enum value.
type MinuteResponse ¶
type MinuteResponse struct {
Dt time.Time `json:"dt"` // Time of the forecasted data
Precipitation float64 `json:"precipitation"` // Precipitation, mm/h. Please note that only mm/h as units of measurement are available for this parameter
}
Minute forecast weather data API response
type MinuteResponseRaw ¶
type MinuteResponseRaw struct {
Dt int64 `json:"dt"` // Time of the forecasted data, unix, UTC
Precipitation float64 `json:"precipitation"` // Precipitation, mm/h. Please note that only mm/h as units of measurement are available for this parameter
}
Minute forecast weather data API response
type OneCallOptions ¶
type OneCallResponse ¶
type OneCallResponse struct {
Current CurrentResponse `json:"current"`
Minutely []MinuteResponse `json:"minutely"`
Hourly []HourlyResponse `json:"hourly"`
Daily []DailyResponse `json:"daily"`
// contains filtered or unexported fields
}
OneCallResponse is parsed from `OneCallResponseRaw` and is a more convenient, ergonomic data structure.
type OneCallResponseRaw ¶
type OneCallResponseRaw struct {
Current CurrentResponseRaw `json:"current"`
Minutely []MinuteResponseRaw `json:"minutely"` // (where available)
Hourly []HourlyResponseRaw `json:"hourly"`
Daily []DailyResponseRaw `json:"daily"`
// contains filtered or unexported fields
}
OneCallResponseRaw is a direct mapping of what is returned from One Call API calls.
func (OneCallResponseRaw) Parse ¶
func (r OneCallResponseRaw) Parse() *OneCallResponse
type Part ¶ added in v0.2.0
type Part struct {
// contains filtered or unexported fields
}
Part is a type that represents a single enum value. It combines the core information about the enum constant and it's defined fields.
func ParsePart ¶ added in v0.2.0
ParsePart parses the input value into an enum value. It returns the parsed enum value or an error if the input is invalid. It is a convenience function that can be used to parse enum values from various input types, such as strings, byte slices, or other enum types.
func (Part) IsValid ¶ added in v0.2.0
IsValid checks whether the Parts value is valid. A valid value is one that is defined in the original enum and not marked as invalid.
func (Part) MarshalBinary ¶ added in v0.2.0
MarshalBinary implements the encoding.BinaryMarshaler interface for Part. It returns the binary representation of the enum value as a byte slice.
func (Part) MarshalJSON ¶ added in v0.2.0
MarshalJSON implements the json.Marshaler interface for Part. It returns the JSON representation of the enum value as a byte slice.
func (Part) MarshalText ¶ added in v0.2.0
MarshalText implements the encoding.TextMarshaler interface for Part. It returns the string representation of the enum value as a byte slice
func (Part) MarshalYAML ¶ added in v0.2.0
MarshalYAML implements the yaml.Marshaler interface for Part. It returns the string representation of the enum value.
func (*Part) Scan ¶ added in v0.2.0
Scan implements the database/sql.Scanner interface for Part. It parses the string representation of the enum value from the database row. It returns an error if the row does not contain a valid enum value.
func (Part) String ¶ added in v0.2.0
String implements the Stringer interface. It returns the canonical absolute name of the enum value.
func (*Part) UnmarshalBinary ¶ added in v0.2.0
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface for Part. It parses the binary representation of the enum value from the byte slice. It returns an error if the byte slice does not contain a valid enum value.
func (*Part) UnmarshalJSON ¶ added in v0.2.0
UnmarshalJSON implements the json.Unmarshaler interface for Part. It parses the JSON representation of the enum value from the byte slice. It returns an error if the input is not a valid JSON representation.
func (*Part) UnmarshalText ¶ added in v0.2.0
UnmarshalText implements the encoding.TextUnmarshaler interface for Part. It parses the string representation of the enum value from the byte slice. It returns an error if the byte slice does not contain a valid enum value.
func (*Part) UnmarshalYAML ¶ added in v0.2.0
UnmarshalYAML implements the yaml.Unmarshaler interface for Planet. It parses the byte slice representation of the enum value and returns an error if the YAML byte slice does not contain a valid enum value.
type Temp ¶
type Temp struct {
Morn float64 `json:"morn"` // Morning temperature.
Day float64 `json:"day"` // Day temperature.
Eve float64 `json:"eve"` // Evening temperature.
Night float64 `json:"night"` // Night temperature.
Min float64 `json:"min"` // Min daily temperature.
Max float64 `json:"max"` // Max daily temperature.
}
type Unit ¶
type Unit struct {
// contains filtered or unexported fields
}
Unit is a type that represents a single enum value. It combines the core information about the enum constant and it's defined fields.
func ParseUnit ¶
ParseUnit parses the input value into an enum value. It returns the parsed enum value or an error if the input is invalid. It is a convenience function that can be used to parse enum values from various input types, such as strings, byte slices, or other enum types.
func (Unit) IsValid ¶
IsValid checks whether the Units value is valid. A valid value is one that is defined in the original enum and not marked as invalid.
func (Unit) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface for Unit. It returns the binary representation of the enum value as a byte slice.
func (Unit) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for Unit. It returns the JSON representation of the enum value as a byte slice.
func (Unit) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface for Unit. It returns the string representation of the enum value as a byte slice
func (Unit) MarshalYAML ¶
MarshalYAML implements the yaml.Marshaler interface for Unit. It returns the string representation of the enum value.
func (*Unit) Scan ¶
Scan implements the database/sql.Scanner interface for Unit. It parses the string representation of the enum value from the database row. It returns an error if the row does not contain a valid enum value.
func (Unit) String ¶
String implements the Stringer interface. It returns the canonical absolute name of the enum value.
func (*Unit) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface for Unit. It parses the binary representation of the enum value from the byte slice. It returns an error if the byte slice does not contain a valid enum value.
func (*Unit) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for Unit. It parses the JSON representation of the enum value from the byte slice. It returns an error if the input is not a valid JSON representation.
func (*Unit) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface for Unit. It parses the string representation of the enum value from the byte slice. It returns an error if the byte slice does not contain a valid enum value.
func (*Unit) UnmarshalYAML ¶
UnmarshalYAML implements the yaml.Unmarshaler interface for Planet. It parses the byte slice representation of the enum value and returns an error if the YAML byte slice does not contain a valid enum value.
type Weather ¶ added in v0.2.0
type Weather struct {
WeatherCondition
Icon string
}
type WeatherCondition ¶
type WeatherCondition struct {
Code int64
Group string
Description string
// contains filtered or unexported fields
}
WeatherCondition is a type that represents a single enum value. It combines the core information about the enum constant and it's defined fields.
func ParseWeatherCondition ¶
func ParseWeatherCondition(input any) (WeatherCondition, error)
ParseWeatherCondition parses the input value into an enum value. It returns the parsed enum value or an error if the input is invalid. It is a convenience function that can be used to parse enum values from various input types, such as strings, byte slices, or other enum types.
func (WeatherCondition) IsValid ¶
func (w WeatherCondition) IsValid() bool
IsValid checks whether the WeatherConditions value is valid. A valid value is one that is defined in the original enum and not marked as invalid.
func (WeatherCondition) MarshalBinary ¶
func (w WeatherCondition) MarshalBinary() ([]byte, error)
MarshalBinary implements the encoding.BinaryMarshaler interface for WeatherCondition. It returns the binary representation of the enum value as a byte slice.
func (WeatherCondition) MarshalJSON ¶
func (w WeatherCondition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for WeatherCondition. It returns the JSON representation of the enum value as a byte slice.
func (WeatherCondition) MarshalText ¶
func (w WeatherCondition) MarshalText() ([]byte, error)
MarshalText implements the encoding.TextMarshaler interface for WeatherCondition. It returns the string representation of the enum value as a byte slice
func (WeatherCondition) MarshalYAML ¶
func (w WeatherCondition) MarshalYAML() ([]byte, error)
MarshalYAML implements the yaml.Marshaler interface for WeatherCondition. It returns the string representation of the enum value.
func (*WeatherCondition) Scan ¶
func (w *WeatherCondition) Scan(value any) error
Scan implements the database/sql.Scanner interface for WeatherCondition. It parses the string representation of the enum value from the database row. It returns an error if the row does not contain a valid enum value.
func (WeatherCondition) String ¶
func (w WeatherCondition) String() string
String implements the Stringer interface. It returns the canonical absolute name of the enum value.
func (*WeatherCondition) UnmarshalBinary ¶
func (w *WeatherCondition) UnmarshalBinary(b []byte) error
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface for WeatherCondition. It parses the binary representation of the enum value from the byte slice. It returns an error if the byte slice does not contain a valid enum value.
func (*WeatherCondition) UnmarshalJSON ¶
func (w *WeatherCondition) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for WeatherCondition. It parses the JSON representation of the enum value from the byte slice. It returns an error if the input is not a valid JSON representation.
func (*WeatherCondition) UnmarshalText ¶
func (w *WeatherCondition) UnmarshalText(b []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface for WeatherCondition. It parses the string representation of the enum value from the byte slice. It returns an error if the byte slice does not contain a valid enum value.
func (*WeatherCondition) UnmarshalYAML ¶
func (w *WeatherCondition) UnmarshalYAML(b []byte) error
UnmarshalYAML implements the yaml.Unmarshaler interface for Planet. It parses the byte slice representation of the enum value and returns an error if the YAML byte slice does not contain a valid enum value.