Documentation
¶
Overview ¶
Package wheretheiss is the library behind the wheretheiss command line: the HTTP client, request shaping, and the typed data models for the Where The ISS At API (api.wheretheiss.at).
The Client here is the spine every command shares. It sets a real User-Agent, paces requests, and retries transient failures (429, 5xx).
Index ¶
Constants ¶
const BaseURL = "https://" + Host
BaseURL is the root every request is built from.
const Host = "api.wheretheiss.at"
Host is the API hostname this client talks to.
const ISSID = 25544
ISSID is the NORAD catalog number for the International Space Station.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
HTTP *http.Client
UserAgent string
BaseURL string
// Rate is the minimum gap between requests. Zero means no pacing.
Rate time.Duration
Retries int
// contains filtered or unexported fields
}
Client talks to the Where The ISS At API over HTTP.
func (*Client) CurrentPosition ¶
CurrentPosition fetches the live ISS position.
type Config ¶
type Config struct {
BaseURL string
UserAgent string
Rate time.Duration
Timeout time.Duration
Retries int
}
Config holds tuneable settings for the client.
type Domain ¶
type Domain struct{}
Domain is the wheretheiss driver. It carries no state; the per-run client is built by the factory Register hands kit.
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 Position ¶
type Position struct {
Name string `json:"name" kit:"id"`
ID int `json:"id"`
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
Altitude float64 `json:"altitude"`
Velocity float64 `json:"velocity"`
Visibility string `json:"visibility"`
Timestamp int64 `json:"timestamp"`
Units string `json:"units"`
}
Position is a single ISS position record, as returned by the API.