search

package
v0.0.0-...-293ca13 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Display

func Display(results chan *Result)

Display writes results to the console window as they are received by the individual goroutines.

func Match

func Match(matcher Matcher, feed *Feed, searchTerm string, results chan<- *Result)

Match is launched as a goroutine for each individual feed to run searches concurrently.

func Register

func Register(feedType string, matcher Matcher)

Register is called to register a matcher for use by the program.

func Run

func Run(searchTerm string)

Run performs the search logic.

Types

type Feed

type Feed struct {
	Name string `json:"site"`
	URL  string `json:"link"`
	Type string `json:"type"`
}

func RetrieveFeeds

func RetrieveFeeds() ([]*Feed, error)

type Matcher

type Matcher interface {
	Search(feed *Feed, searchTerm string) ([]*Result, error)
}

Matcher defines the behavior required by types that want to implement a new search type.

type Result

type Result struct {
	Field   string
	Content string
}

Result contains the result of a search.

Jump to

Keyboard shortcuts

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