Documentation ¶
Index ¶
- Constants
- func GetCurrentStatus(c context.Context) (*prt.Status, error)
- func NotifyFCM(c context.Context, status *prt.Status, weather *Weather) (fcm.Response, error)
- func NotifyPushbullet(c context.Context, status *prt.Status) error
- func StoreNewStatus(c context.Context, status *prt.Status) error
- func WriteJSON(w http.ResponseWriter, data interface{}) error
- type Weather
Constants ¶
View Source
const (
// FCMTopic is a string of the FCM message topic the notification is pushed to
FCMTopic = "/topics/prt-updates"
)
Variables ¶
This section is empty.
Functions ¶
func WriteJSON ¶
func WriteJSON(w http.ResponseWriter, data interface{}) error
Types ¶
type Weather ¶
type Weather struct { // Temperature is the temperature in Fahrenheit Temperature float32 `json:"temperature"` // Humidity is the relative humidity percentage Humidity float32 `json:"humidity"` // Weather contains the simple weather conditions and current icon name Weather string `json:"weather"` // Conditions contains a description of the weather conditions Conditions string `json:"conditions"` // FeelsLike is the "feels like" temperature in Fahrenheit FeelsLike float32 `json:"feelsLike"` // Precip1hr is the inches of precipitation from the past hour Precip1hr float32 `json:"precip1hr"` // PrecipToday is the inches of precipitation today PrecipToday float32 `json:"precipToday"` // Visibility is the relative kilometers of visibility Visibility float32 `json:"visibility"` // WindDir is the direction of the wind WindDir string `json:"windDir"` // WindSpeed is the speed of the wind in miles per hour (MPH) WindSpeed float32 `json:"windSpeed"` }
Weather contains data from Weather Underground response
Click to show internal directories.
Click to hide internal directories.