Documentation ¶
Index ¶
Constants ¶
View Source
const ApiUrl = "http://weather.olp.yahooapis.jp/v1/place?coordinates=%s&appid=%s"
View Source
const AppId = "あなたのアプリケーション ID"
http://developer.yahoo.co.jp/ で取得したあなたのアプリケーション ID
View Source
const Coordinates = "139.691764,35.689661"
予報位置。api のパラメーター。デフォルトでは都庁のあたりです
View Source
const FeedUri = "http://weather.yahoo.co.jp/weather/jp/13/4410/13104.html"
View Source
const RainThreshould = 0.5
雨と判断する下限値 mm/h
View Source
const SpotName = "新宿"
予報位置。表示用
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RainStatus ¶
type RainStatus int
const ( NoRain RainStatus = iota // 降っていない BeginRain LightRain // 小雨 数時間続いても1mm未満の雨 SoftRain // 弱い雨 3mm未満 ModerateRain // やや強い雨 10mm以上20mm未満 HeavyRain // 強い雨 20mm以上 EndRain BeginForecastRain ForecastSoftRain // 弱い雨 3mm未満 ForecastModerateRain // やや強い雨 10mm以上20mm未満 ForecastHeavyRain // 強い雨 20mm以上 EndForecastRain )
type Result ¶
type Result struct { UpdatedTime int64 // 前回の更新時刻 Unix time RainTime int64 // 最後に実際に雨が降っていた時刻 Unix time Status RainStatus Text string }
前回の情報
type WeatherInfo ¶
type WeatherInfo struct { Type string // observation or forecast Time int64 // Unix time Rainfall float64 // mm/h }
取得した気象情報
type WeatherInfos ¶
type WeatherInfos []WeatherInfo
予報時刻でのソート用
func (WeatherInfos) Len ¶
func (w WeatherInfos) Len() int
func (WeatherInfos) Less ¶
func (w WeatherInfos) Less(i, j int) bool
func (WeatherInfos) Swap ¶
func (w WeatherInfos) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.