Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface {
// contains filtered or unexported methods
}
Cache represents necessary operations to cache results
type Engine ¶
type Engine struct { ResultCache Cache // contains filtered or unexported fields }
Engine represents a news processing engine
func (*Engine) ProcessKeywords ¶
func (e *Engine) ProcessKeywords(kw []string) (*SearchResponse, error)
ProcessKeywords processes a given set of keywords, caching where possible
type Result ¶
type Result struct { // article metadata URL string `json:"url"` // note: treated as unique identifier Source string `json:"source"` Title string `json:"title"` Description string `json:"description"` ImgURL string `json:"imgURL"` PublishedAt string `json:"publishedAt"` Author string `json:"author,omitempty"` // article scores for different named scoring functions Scores map[string]interface{} `json:"scores"` }
Result represents a processing result
type SearchResponse ¶
type SearchResponse struct {
Results []Result `json:"results"`
}
SearchResponse contains the response of a keyword search analysis
Click to show internal directories.
Click to hide internal directories.