Documentation ¶
Index ¶
Constants ¶
const DefaultStationsEndpoint = "https://opendap.co-ops.nos.noaa.gov/stations/stationsXML.jsp"
DefaultStationsEndpoint is the default stations endpoint from NOAA.
const MaxStationsSearchChunkSize = 10
MaxStationsSearchChunkSize is used when searching for nearest station with goroutines
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { URL string HTTPClient lib.HTTPGetter StationsCache []Station }
Client interacts with NOAA.
func NewClient ¶
func NewClient() *Client
NewClient creates a new NOAAStationClient with the default URL.
func (*Client) GetNearestStation ¶
func (s *Client) GetNearestStation(coords lib.GeoCoordinates) *StationDistance
GetNearestStation gets the nearest station to a given set of coordinates.
type GetStationResponse ¶
type GetStationResponse struct { XMLName xml.Name `xml:"stations"` Stations []Station `xml:"station"` }
GetStationResponse represents a response to retrieving the station data
type Station ¶
type Station struct { XMLName xml.Name `xml:"station"` Name string `xml:"name,attr"` ID int `xml:"ID,attr"` Metadata StationMetadata `xml:"metadata"` Capabilities []StationCapability `xml:"parameter"` }
Station represents a station
type StationCapability ¶
type StationCapability struct { XMLName xml.Name `xml:"parameter"` Name string `xml:"name,attr"` SensorID string `xml:"sensorID,attr"` DCP int `xml:"DCP,attr"` Status int `xml:"status,attr"` }
StationCapability specifies one NOAA capability for the NOAA API.
type StationDistance ¶
type StationDistance struct { Distance float64 From lib.GeoCoordinates Station Station }
StationDistance describes the distance from a set of coordinates to a station.
type StationLocation ¶
type StationLocation struct { XMLName xml.Name `xml:"location"` Lat float64 `xml:"lat"` Long float64 `xml:"long"` State string `xml:"state"` }
StationLocation contains information about the station's location.
type StationMetadata ¶
type StationMetadata struct { XMLName xml.Name `xml:"metadata"` Location StationLocation `xml:"location"` DateEstablished string `xml:"date_established"` }
StationMetadata contains metadata about a station.