Documentation ¶
Overview ¶
Package infoextract provides the interface to extract information from various sources.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrURIInvalid = errors.New("uri invalid")
)
Functions ¶
func GetGenresByName ¶
GetGenresByName returns genres for the given names and creates new ones for those not found.
Types ¶
type ExtractorPool ¶
type ExtractorPool struct {
// contains filtered or unexported fields
}
An ExtractorPool collects extractors.
func CollectExtractors ¶
func CollectExtractors(extractors ...Extractor) *ExtractorPool
Create a new extractor pool from the given extractors. Passing a nil extractor will cause a panic.
func (*ExtractorPool) GetExtractor ¶
func (p *ExtractorPool) GetExtractor(extractorID string) (Extractor, bool)
GetExtractor returns the extractor with the given extractor id.
func (*ExtractorPool) ResolveExtractor ¶
func (p *ExtractorPool) ResolveExtractor(uri string) (Extractor, bool)
ResolveExtractor finds an extractor for the given uri. To be discovered, an extractor has to register using AddCheckers.
type HasHostnames ¶
type HasHostnames interface { Extractor // URLHostnames returns a slice of hostnames. // The hostnames shouldn't include "www.". URLHostnames() []string }
HasHostnames is an interface for an Extractor which extracts for specific hostnames.
type URIChecker ¶
type URIChecker interface { Extractor // CheckURI checks whether the extractor works for the given uri. CheckURI(uri string) bool }
A URIChecker is an Extractor which extracts URIs.
Click to show internal directories.
Click to hide internal directories.