Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultPref = 13
Variables ¶
This section is empty.
Functions ¶
func GetWeatherName ¶
Convert WMO codes to their corresponding strings.
Types ¶
type DailyData ¶
type DailyData struct {
Time []string `json:"time"`
WeatherCode []int `json:"weather_code"`
Temperature2mMax []float64 `json:"temperature_2m_max"`
Temperature2mMin []float64 `json:"temperature_2m_min"`
PrecipitationSum []float64 `json:"precipitation_sum"`
PrecipitationHours []float64 `json:"precipitation_hours"`
}
type DailyUnits ¶
type DailyUnits struct {
Time string `json:"time"`
WeatherCode string `json:"weather_code"`
Temperature2mMax string `json:"temperature_2m_max"`
Temperature2mMin string `json:"temperature_2m_min"`
PrecipitationSum string `json:"precipitation_sum"`
PrecipitationHours string `json:"precipitation_hours"`
}
type HourlyData ¶ added in v0.4.0
type HourlyForecast24h ¶ added in v0.4.0
type HourlyForecast24h struct {
Times []string
Temperatures []float64
Precipitations []float64
WindSpeeds []float64
WeatherCodes []int
RelativeHumidities []int
}
先24時間分のデータを格納するための構造体
func GetNext24Hours ¶ added in v0.4.0
func GetNext24Hours(hourly HourlyData, timezone string) (*HourlyForecast24h, error)
HourlyDataから現在時刻以降の24時間分を抽出する関数
type HourlyUnits ¶ added in v0.4.0
type Location ¶
type Location struct {
Prefecture string // 都道府県名
City string // 都市名
Latitude float64 // 緯度
Longitude float64 // 経度
}
県庁所在地の情報を表す構造体
func GetPrefCapitalData ¶
都道府県コードから Location を取得
type WeatherResponse ¶
type WeatherResponse struct {
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
GenerationtimeMs float64 `json:"generationtime_ms"`
UtcOffsetSeconds int `json:"utc_offset_seconds"`
Timezone string `json:"timezone"`
TimezoneAbbreviation string `json:"timezone_abbreviation"`
Elevation float64 `json:"elevation"`
HourlyUnits HourlyUnits `json:"hourly_units"`
Hourly HourlyData `json:"hourly"`
DailyUnits DailyUnits `json:"daily_units"`
Daily DailyData `json:"daily"`
}
func GetWeatherInfo ¶
func GetWeatherInfo(latitude, longitude float64, useJma bool) (*WeatherResponse, error)
Click to show internal directories.
Click to hide internal directories.