Documentation
¶
Index ¶
Constants ¶
View Source
const (
NWS_BASE_URL = "https://api.weather.gov"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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) 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"` }
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.