Documentation ¶
Index ¶
- Constants
- type DailyPeriod
- type DailyProps
- type HourlyPeriod
- type HourlyProps
- type NwsClient
- func (c *NwsClient) CoordinatesToPoint(lat float64, lon float64) (Point, error)
- func (c *NwsClient) GetDailyForecast(p Point) (DailyProps, error)
- func (c *NwsClient) GetHourlyForecast(p Point) (HourlyProps, error)
- func (c *NwsClient) GetLatestObservations(p Point) (Observations, error)
- func (c *NwsClient) GetStations(p Point) ([]string, error)
- type Observations
- type Point
- type PointProps
- type UnitValue
Constants ¶
View Source
const (
NWS_BASE_URL = "https://api.weather.gov"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DailyPeriod ¶ added in v0.20.0
type DailyPeriod struct { Number int `json:"number,omitempty"` Name string `json:"name,omitempty"` StartTime string `json:"startTime,omitempty"` EndTime string `json:"endTime,omitempty"` IsDaytime bool `json:"isDaytime,omitempty"` Temperature int `json:"temperature,omitempty"` TemperatureUnit string `json:"temperatureUnit,omitempty"` TemperatureTrend string `json:"temperatureTrend,omitempty"` ProbabilityOfPrecipitation UnitValue[int] `json:"probabilityOfPrecipitation,omitempty"` Dewpoint UnitValue[float64] `json:"dewpoint,omitempty"` RelativeHumidity UnitValue[int] `json:"relativeHumidity,omitempty"` WindSpeed string `json:"windSpeed,omitempty"` WindDirection string `json:"windDirection,omitempty"` Icon string `json:"icon,omitempty"` ShortForecast string `json:"shortForecast,omitempty"` DetailedForecast string `json:"detailedForecast,omitempty"` }
type DailyProps ¶ added in v0.20.0
type DailyProps struct { Updated time.Time `json:"updated"` Units string `json:"units"` Periods []DailyPeriod `json:"periods"` }
type HourlyPeriod ¶
type HourlyPeriod struct { Number int `json:"number"` StartTime time.Time `json:"startTime"` Endime time.Time `json:"endTime"` IsDayTime bool `json:"isDayTime"` Temperature int `json:"temperature"` ProbabilityOfPrecipitation UnitValue[int] `json:"probabilityOfPrecipitation"` DewPoint UnitValue[float64] `json:"dewpoint"` ShortForecast string `json:"shortForecast"` }
type HourlyProps ¶
type HourlyProps struct { Updated time.Time `json:"updated"` Units string `json:"units"` Periods []HourlyPeriod `json:"periods"` }
func (HourlyProps) GetHighLow ¶
func (p HourlyProps) GetHighLow(hours int) (high int, low int)
type NwsClient ¶
type NwsClient struct {
// contains filtered or unexported fields
}
func (*NwsClient) CoordinatesToPoint ¶
func (*NwsClient) GetDailyForecast ¶ added in v0.20.0
func (c *NwsClient) GetDailyForecast(p Point) (DailyProps, error)
func (*NwsClient) GetHourlyForecast ¶
func (c *NwsClient) GetHourlyForecast(p Point) (HourlyProps, error)
func (*NwsClient) GetLatestObservations ¶
func (c *NwsClient) GetLatestObservations(p Point) (Observations, error)
type Observations ¶
type Point ¶
type Point struct { ID string `json:"id"` Properties PointProps `json:"properties"` Lat float64 Lon float64 }
type PointProps ¶
type PointProps struct { GridId string `json:"gridId"` GridX int `json:"gridX"` GridY int `json:"gridY"` Forecast string `json:"forecast"` ForecastHourly string `json:"forecastHourly"` ForecastGridData string `json:"forecastGridData"` ForecastZone string `json:"forecastZone"` TimeZone string `json:"timeZone"` RadarStation string `json:"radarStation"` ObservationStations string `json:"observationStations"` }
Click to show internal directories.
Click to hide internal directories.