Documentation
¶
Index ¶
Constants ¶
View Source
const APIPath = "/planetary/apod"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Opts ¶
type Opts func(*Request)
func WithAPIKey ¶
WithAPIKey returns function for setting Request.APIKey.
func WithEndDate ¶
WithEndDate returns function for setting Request.EndDate.
func WithStartDate ¶
WithStartDate returns function for setting Request.StartDate.
func WithThumbs ¶
WithThumbs returns function for setting Request.Thumbs.
type Request ¶ added in v0.2.0
type Request struct {
Date nasaapi.Date `json:"date,omitempty"` // The date of the APOD image to retrieve
StartDate nasaapi.Date `json:"start_date,omitempty"` // The start of a date range, when requesting date for a range of dates. Cannot be used with date.
EndDate nasaapi.Date `json:"end_date,omitempty"` // The end of the date range, when used with start_date.
Count int `json:"count,omitempty"` // If this is specified then count randomly chosen images will be returned. Cannot be used with date or start_date and end_date.
Thumbs bool `json:"thumbs,omitempty"` // Return the URL of video thumbnail. If an APOD is not a video, this parameter is ignored.
APIKey string `json:"api_key"` // api.nasa.gov key for expanded usage
}
Request is for context of APOD API.
func (*Request) Get ¶ added in v0.2.0
Get method gets APOD data from NASA API, and returns []*Response instance.
func (*Request) GetRawData ¶ added in v0.2.0
GetRawData method gets APOD data from NASA API, and returns raw response string.
type Response ¶
type Response struct {
Copyright string `json:"copyright,omitempty"`
Date nasaapi.Date `json:"date,omitempty"`
Explanation string `json:"explanation,omitempty"`
HdUrl string `json:"hdurl,omitempty"`
MediaType string `json:"media_type,omitempty"`
ServiceVersion string `json:"service_version,omitempty"`
Title string `json:"title,omitempty"`
Url string `json:"url,omitempty"`
ThumbnailUrl string `json:"thumbnail_url,omitempty"`
}
Response is response data from NASA APOD API.
Click to show internal directories.
Click to hide internal directories.