Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Article ¶
type Article struct {
Source ArticleSource `json:"source"`
Author string `json:"author"`
Title string `json:"title"`
Description string `json:"description"`
URL string `json:"url"`
URLToImage string `json:"urlToImage"`
PublishedAt time.Time `json:"publishedAt"`
}
Article struct for unmarshaling article json data.
type ArticleSource ¶
ArticleSource struct for unmarshaling source data embeded in article json.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client for api requests.
func (*Client) GetEverything ¶
func (cli *Client) GetEverything(args []string) (*NewsResponse, error)
GetEverything Get every article relevant to given parameters.
func (*Client) GetSources ¶
func (cli *Client) GetSources(args []string) (*SourcesResponse, error)
GetSources get all sources relevant to given parameters.
func (*Client) GetTopHeadlines ¶
func (cli *Client) GetTopHeadlines(args []string) (*NewsResponse, error)
GetTopHeadlines get top news headlines relevant to given parameters.
type Error ¶
type Error struct {
Status string `json:"status"`
Code string `json:"code"`
Message string `json:"message"`
}
Error json struct for error message.
type NewsResponse ¶
type NewsResponse struct {
Status string `json:"status"`
TotalResults int `json:"totalResults"`
Articles []Article `json:"articles"`
}
NewsResponse json struct for news articles.
type Source ¶
type Source struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
URL string `json:"url"`
Category string `json:"category"`
Language string `json:"language"`
Country string `json:"country"`
}
Source struct for unmarshaling source json data.
type SourcesResponse ¶
SourcesResponse json struct for source.
Click to show internal directories.
Click to hide internal directories.