Versions in this module Expand all Collapse all v0 v0.0.9 Sep 25, 2018 Changes in this version + const Strategy1st + const StrategyConcurrent + type Article struct + Attribs map[string]string + Content string + ContentType string + License string + Source string + Title string + func (article Article) Validate() error + type Cache interface + Set func(q Query, rs []Article) error + type ClipboardMonitor struct + Instance *Instance + Interval time.Duration + MaxWords int + func (cbm *ClipboardMonitor) Run(ctx context.Context) error + type Concurrent struct + func NewConcurrent(logger Logger) *Concurrent + func (con Concurrent) Execute(ctx context.Context, query Query, sources []RegisteredSource) ([]Article, error) + type Instance struct + func New(cache Cache, logger Logger) *Instance + func (ins *Instance) RegisterSource(name string, src Source) error + func (ins *Instance) RegisterStrategy(name string, strategy Strategy) + func (ins Instance) GetSources() []RegisteredSource + func (ins Instance) Search(ctx context.Context, query Query, strategyName string) ([]Article, error) + type Logger interface + Debugf func(format string, args ...interface{}) + Errorf func(format string, args ...interface{}) + Fatalf func(format string, args ...interface{}) + Infof func(format string, args ...interface{}) + Warnf func(format string, args ...interface{}) + type NthResult struct + func NewNthResult(n int, logger Logger) *NthResult + func (nth *NthResult) Execute(ctx context.Context, query Query, srcs []RegisteredSource) ([]Article, error) + type Query struct + Attribs map[string]string + Text string + func (query Query) Validate() error + type RegisteredSource struct + Name string + type Server struct + func NewServer(ins *Instance, defaultStrategy string) *Server + func (srv Server) ServeHTTP(wr http.ResponseWriter, req *http.Request) + type Source interface + Search func(ctx context.Context, q Query) ([]Article, error) + type Strategy interface + Execute func(ctx context.Context, query Query, sources []RegisteredSource) ([]Article, error)