Documentation
¶
Index ¶
- Variables
- type Extractor
- type Registry
- func (r *Registry) GetAllExtractors() []Extractor
- func (r *Registry) GetByHost(host string) (Extractor, bool)
- func (r *Registry) GetByName(name string) (Extractor, bool)
- func (r *Registry) GetByURL(rawURL string) (Extractor, error)
- func (r *Registry) GetSupportedHosts() []string
- func (r *Registry) GetSupportedSources() []models.MediaSource
- func (r *Registry) Register(ext Extractor) error
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultRegistry = NewRegistry()
DefaultRegistry is the global extractor registry
Functions ¶
This section is empty.
Types ¶
type Extractor ¶
type Extractor interface {
// Name returns the unique name of the extractor
Name() string
// Hosts returns the list of hosts that this extractor supports
Hosts() []string
// Extract extracts media from the given URL
Extract(ctx context.Context, url string) (*models.Media, error)
}
Extractor defines the interface that all media extractors must implement
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages all registered extractors
func (*Registry) GetAllExtractors ¶
GetAllExtractors returns all registered extractors
func (*Registry) GetSupportedHosts ¶
GetSupportedHosts returns all supported hosts
func (*Registry) GetSupportedSources ¶
func (r *Registry) GetSupportedSources() []models.MediaSource
GetSupportedSources returns all registered media sources
Click to show internal directories.
Click to hide internal directories.