Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Sources []NewsSource `json:"sources"`
}
Config defines settings of app. Currently, the embedded file provides details of the news sources.
type NewsHandler ¶
type NewsHandler struct {
// contains filtered or unexported fields
}
NewsHandler defines the type which stores and handles the feed data.
func (*NewsHandler) GetConfiguredSources ¶
func (n *NewsHandler) GetConfiguredSources(config string) []NewsSource
GetConfiguredSources gets the news sources from the config data.
func (*NewsHandler) HandleNewsRequests ¶
func (n *NewsHandler) HandleNewsRequests(w http.ResponseWriter, _ *http.Request)
HandleNewsRequests handles the incoming requests.
func (*NewsHandler) UpdateFeed ¶
func (n *NewsHandler) UpdateFeed(s NewsSource) error
UpdateFeed updates the news feed data content.
type NewsSource ¶
type NewsSource struct { Url string `json:"url"` ClientType string `json:"clientType"` Topic string `json:"topic"` EntryCount int `json:"entryCount"` }
NewsSource defines the type which stores the details of a news source.
type RedditJsonType ¶
type RedditJsonType struct { Kind string `json:"kind"` Data struct { Children []struct { Data struct { Title string `json:"title"` Id string `json:"id"` Url string `json:"url"` } `json:"data"` } `json:"children"` } `json:"data"` }
RedditJsonType represents the json content received from the reddit website.
Click to show internal directories.
Click to hide internal directories.