Documentation
¶
Overview ¶
Package exoplanet is the library behind the exoplanet command line: the HTTP client, request shaping, and typed data models for the NASA Exoplanet Archive TAP service (https://exoplanetarchive.ipac.caltech.edu/TAP/).
Queries are written in ADQL (SELECT TOP N ... FROM ps WHERE ...). No API key or registration is required. The Client paces requests, sets a real User-Agent, and retries transient failures (429 and 5xx).
Index ¶
- Constants
- type Client
- func (c *Client) GetByHost(ctx context.Context, host string, limit int) ([]Planet, error)
- func (c *Client) GetPlanet(ctx context.Context, name string) (*Planet, error)
- func (c *Client) ListByMethod(ctx context.Context, method string, limit int) ([]Planet, error)
- func (c *Client) SearchByName(ctx context.Context, fragment string, limit int) ([]Planet, error)
- type Config
- type Domain
- type Planet
Constants ¶
const BaseURL = "https://" + Host + "/TAP"
BaseURL is the root every TAP request is built from.
const Host = "exoplanetarchive.ipac.caltech.edu"
Host is the API hostname.
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 Exoplanet Archive TAP service over HTTP.
func (*Client) ListByMethod ¶
ListByMethod returns planets discovered by a given method.
type Config ¶
type Config struct {
BaseURL 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 for the NASA TAP service.
type Domain ¶
type Domain struct{}
Domain is the exoplanet driver for the kit framework.
func (Domain) Info ¶
func (Domain) Info() kit.DomainInfo
Info describes the scheme, hostnames, and binary identity.
type Planet ¶
type Planet struct {
Name string `json:"name" kit:"id"`
HostStar string `json:"host_star"`
MassEarth *float64 `json:"mass_earth,omitempty"`
RadiusEarth *float64 `json:"radius_earth,omitempty"`
OrbitalPeriodDays *float64 `json:"orbital_period_days,omitempty"`
DistanceParsec *float64 `json:"distance_parsec,omitempty"`
DiscoveryMethod string `json:"discovery_method,omitempty"`
DiscoveryYear *int `json:"discovery_year,omitempty"`
}
Planet holds flattened planet metadata from the NASA Exoplanet Archive. Pointer fields represent measurements that may be absent (null) in the archive.