Help us shape the future of Go! Take the 2026 Go Developer Survey

source

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiscoveryMode

type DiscoveryMode uint8
const (
	DNSMode DiscoveryMode = iota
	TLDMode
	DomainMode
)

func (DiscoveryMode) String

func (dm DiscoveryMode) String() string

type DiscoveryType

type DiscoveryType uint8
const (
	Active DiscoveryType = iota
	Passive
)

type Result

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

type ResultType

type ResultType int
const (
	Domain ResultType = iota
	Error
)

type Source

type Source interface {
	// Run takes a query as argument and a session object
	// which contains the extractor for domain, 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

	SupportedDiscoveryModes() []DiscoveryMode

	DiscoveryType() DiscoveryType

	// 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