processing

package
v0.0.0-...-0aa5000 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2020 License: MPL-2.0 Imports: 10 Imported by: 0

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 NewEngine

func NewEngine(c *config.Config, cache Cache) (*Engine, error)

NewEngine is the news processing engine constructor

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL