Documentation
¶
Index ¶
Constants ¶
View Source
const ( MediaImage = "image" MediaVideo = "video" )
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 ¶
type Request struct { Date values.Date `json:"date,omitempty"` // The date of the APOD image to retrieve StartDate values.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 values.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.
type Response ¶
type Response struct { Copyright string `json:"copyright,omitempty"` Date values.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.