Documentation ¶
Index ¶
- func FormatRestyResponse(resp *resty.Response, err error) (*resty.Response, error)
- type Client
- func (inst *Client) ObservationByTown(town string) (*Observations, error)
- func (inst *Client) ObservationByZip(town string) (*Observations, error)
- func (inst *Client) Observations(geo string) (*Observations, error)
- func (inst *Client) SearchByTown(town string) (*Search, string, error)
- func (inst *Client) SearchByZip(postCode string) (*Search, string, error)
- type Error
- type FoundMessage
- type Message
- type Observations
- type Search
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatRestyResponse ¶
Types ¶
type Client ¶
type Client struct {
Rest *resty.Client
}
func (*Client) ObservationByTown ¶
func (inst *Client) ObservationByTown(town string) (*Observations, error)
func (*Client) ObservationByZip ¶
func (inst *Client) ObservationByZip(town string) (*Observations, error)
func (*Client) Observations ¶
func (inst *Client) Observations(geo string) (*Observations, error)
func (*Client) SearchByTown ¶
type Error ¶
type Error struct { Code int `json:"error_code,omitempty"` Message string `json:"error_message,omitempty"` }
An Error maps to Form3 API error responses
type FoundMessage ¶
type FoundMessage struct {
Found bool `json:"found"`
}
type Observations ¶
type Observations struct { Metadata struct { ResponseTimestamp time.Time `json:"response_timestamp"` IssueTime time.Time `json:"issue_time"` ObservationTime time.Time `json:"observation_time"` } `json:"metadata"` Data struct { Temp float64 `json:"temp"` TempFeelsLike float64 `json:"temp_feels_like"` Wind struct { SpeedKilometre int `json:"speed_kilometre"` SpeedKnot int `json:"speed_knot"` Direction string `json:"direction"` } `json:"wind"` Gust struct { SpeedKilometre int `json:"speed_kilometre"` SpeedKnot int `json:"speed_knot"` } `json:"gust"` MaxGust struct { SpeedKilometre int `json:"speed_kilometre"` SpeedKnot int `json:"speed_knot"` Time time.Time `json:"time"` } `json:"max_gust"` MaxTemp struct { Time time.Time `json:"time"` Value float64 `json:"value"` } `json:"max_temp"` MinTemp struct { Time time.Time `json:"time"` Value float64 `json:"value"` } `json:"min_temp"` RainSince9Am int `json:"rain_since_9am"` Humidity int `json:"humidity"` Station struct { BomId string `json:"bom_id"` Name string `json:"name"` Distance int `json:"distance"` } `json:"station"` } `json:"data"` }
Click to show internal directories.
Click to hide internal directories.