search

package
v0.0.0-...-694ccaf Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(domain, name string, minPrice, maxPrice uint) ([]string, error)

Do performs a search with the given parameters and returns a list of products URLs.

Types

type Error

type Error string
const (
	ErrCaptcha Error = "captcha challenge"
)

func (Error) Error

func (e Error) Error() string

type Searcher

type Searcher struct {
	CachePeriod time.Duration
	// contains filtered or unexported fields
}

Searcher searches for products and provides the found products with an internal cache to avoid getting products details too often.

The searcher is NOT concurrency safe.

func New

func New(cachePeriod time.Duration) *Searcher

func (*Searcher) Search

func (s *Searcher) Search(domain, name string, minPrice, maxPrice uint) ([]product.Product, error)

Search performs a search with the given parameters and returns a list of products. It can produce partial results so you should check for the products even if an error is returned.

Jump to

Keyboard shortcuts

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