Documentation
¶
Overview ¶
Package nasaneo exposes the NASA NeoWs near-Earth object API as a kit Domain driver.
A multi-domain host (ant) enables it with a single blank import:
import _ "github.com/tamnd/nasaneo-cli/nasaneo"
The same Domain also builds the standalone neo binary (see cli.NewApp).
Package nasaneo is the library behind the neo command line: the HTTP client, request shaping, and typed data models for NASA's Near Earth Object Web Service (NeoWs) at api.nasa.gov/neo/rest/v1.
NeoWs provides information on near-Earth asteroids: estimated diameters, close approach distances, velocity, and hazard classification. Requires an api_key (DEMO_KEY for testing; register at api.nasa.gov for 1000/hr).
Index ¶
Constants ¶
const Host = "api.nasa.gov"
Host is the API host this client talks to.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client talks to the NASA NeoWs API over HTTP.
func (*Client) Feed ¶
Feed fetches near-Earth objects for a date range (max 7 days). Results are flattened and sorted by date then name.
type Config ¶
type Config struct {
BaseURL string
APIKey string
UserAgent string
Rate time.Duration
Timeout time.Duration
Retries int
}
Config holds all tunable parameters for the Client.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns a Config with sensible defaults.
type Domain ¶
type Domain struct{}
Domain is the nasaneo driver.
func (Domain) Info ¶
func (Domain) Info() kit.DomainInfo
Info describes the scheme, the hostnames a pasted link is matched against, and the identity reused for the binary's help and version.
type NEO ¶
type NEO struct {
ID string `json:"id"`
Name string `json:"name"`
Hazardous bool `json:"hazardous"`
MagnitudeH float64 `json:"magnitude_h"`
DiamMinKm float64 `json:"diam_min_km"`
DiamMaxKm float64 `json:"diam_max_km"`
CloseApproachDate string `json:"close_approach_date"`
MissDistAU string `json:"miss_dist_au"`
MissDistLunar string `json:"miss_dist_lunar"`
MissDistKm string `json:"miss_dist_km"`
VelocityKPS string `json:"velocity_kps"`
URL string `json:"url"`
}
NEO is a near-Earth asteroid record.