source

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	Type      ResultType
	Source    string
	Value     string
	Reference string
	Error     error
}

type ResultType

type ResultType int
const (
	Url ResultType = iota
	Error
)

type Source

type Source interface {
	// Run takes a query as argument and a session object
	// which contains the extractor for url, http client
	// and other stuff.
	Run(context.Context, string, *session.Session) <-chan Result

	// Name returns the name of the source. It is preferred to use lower case names.
	Name() string

	// IsDefault returns true if the current source should be
	// used as part of the default execution.
	IsDefault() bool

	// NeedsKey returns true if the source requires an API key
	NeedsKey() bool

	AddApiKeys([]string)

	// Statistics returns the scrapping statistics for the source
	Statistics() Statistics
}

Source is an interface inherited by each passive source

type Statistics

type Statistics struct {
	TimeTaken time.Duration
	Errors    int
	Results   int
	Skipped   bool
}

Statistics contains statistics about the scraping process

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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