search

package
v0.0.0-...-23a64cd Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package search : search.go manages the searching of results against Google, Yahoo and Bing.

Package search : seachers.go contains all the different implementations for the existing searchers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bing

func Bing(s *searchSession)

Bing search will be added to this search session if this option is provided.

func Google

func Google(s *searchSession)

Google search will be added to the search session if this option is provided.

func OnlyFirst

func OnlyFirst(s *searchSession)

OnlyFirst is an option that will restrict the search session to just the first result.

func Yahoo

func Yahoo(s *searchSession)

Yahoo search will be enabled if this option is provided as an argument to Submit.

Types

type Result

type Result struct {
	Engine      string
	Title       string
	Description string
	Link        string
}

Result represents a search result that was found.

func Submit

func Submit(query string, options ...func(*searchSession)) []Result

Submit uses goroutines and channels to perform a search against the three leading search engines concurrently.

type Searcher

type Searcher interface {
	Search(searchTerm string, searchResults chan<- []Result)
}

Searcher declares an interface used to leverage different search engines to find results.

Directories

Path Synopsis
This sample program demonstrates how to implement a pattern for concurrent requesting results from different systems and either wait for all the results to return or just the first one.
This sample program demonstrates how to implement a pattern for concurrent requesting results from different systems and either wait for all the results to return or just the first one.

Jump to

Keyboard shortcuts

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