Documentation ¶
Index ¶
- func ErrString(err error) interface{}
- func ExpandPath(p string) (string, error)
- func List() map[string]Provider
- func Register(p Provider)
- type FeedBacker
- type HTTPClient
- func (c *HTTPClient) Get(ctx context.Context, url string, q *url.Values, body io.Reader) ([]byte, error)
- func (c *HTTPClient) Head(ctx context.Context, url string, q *url.Values, body io.Reader) ([]byte, error)
- func (c *HTTPClient) Post(ctx context.Context, url string, q *url.Values, body io.Reader) ([]byte, error)
- type Provider
- type ProviderConfig
- type ProviderConfigFn
- type ProviderSettings
- type Runner
- type RunnerConfig
- type RunnerConfigFn
- type Settings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpandPath ¶ added in v0.16.0
ExpandPath variables contained in the path
- ENV variables like $HOME
- ~ for home dir
Types ¶
type FeedBacker ¶ added in v0.16.0
type HTTPClient ¶ added in v0.16.0
type HTTPClient struct {
// contains filtered or unexported fields
}
func NewHTTPClient ¶ added in v0.16.0
func NewHTTPClient(c ProviderConfig) *HTTPClient
type Provider ¶
type Provider interface { Configure(fns ...ProviderConfigFn) // Pass general configuration Name() string // Provider's name MediaList(context.Context, []*matcher.MatchRequest) chan *media.Media // List of available shows that match one of MatchRequest GetMediaDetails(context.Context, *media.Media) error // Download more details when available }
Provider is the interface for a provider
type ProviderConfig ¶ added in v0.16.0
type ProviderConfig struct { Log *mylog.MyLog // Logger HitsLimiter *rate.Limiter // Limit the number of hits per second // TODO ByteLimiter *rate.Limiter // Limit the number of bytes per second UserAgent string // User agent to use for queries }
Config carries the configuration to providers
type ProviderConfigFn ¶ added in v0.16.0
type ProviderConfigFn func(c ProviderConfig) ProviderConfig
func ProviderHitsPerSecond ¶ added in v0.16.0
func ProviderHitsPerSecond(limiter *rate.Limiter) ProviderConfigFn
func ProviderLog ¶ added in v0.16.0
func ProviderLog(l *mylog.MyLog) ProviderConfigFn
func ProviderUserAgent ¶ added in v0.16.0
func ProviderUserAgent(agent string) ProviderConfigFn
type ProviderSettings ¶ added in v0.16.0
type Runner ¶ added in v0.16.0
type Runner struct {
// contains filtered or unexported fields
}
Runner handle downloads for a provider
func (*Runner) GetNewMediasList ¶ added in v0.16.0
func (r *Runner) GetNewMediasList(ctx context.Context, mr []*matcher.MatchRequest) <-chan *media.Media
GetNewMediasList pull the providers for medias available on its web site, check if it isn't already downloaded before sent it back to the channel
func (*Runner) SubmitDownload ¶ added in v0.16.0
func (*Runner) WaitUntilCompletion ¶ added in v0.16.0
type RunnerConfig ¶ added in v0.16.0
type RunnerConfig struct {
// contains filtered or unexported fields
}
type RunnerConfigFn ¶ added in v0.16.0
type RunnerConfigFn func(c RunnerConfig) RunnerConfig
func RunnerWithConcurentLimit ¶ added in v0.16.0
func RunnerWithConcurentLimit(limit int) RunnerConfigFn
func RunnerWithLogger ¶ added in v0.16.0
func RunnerWithLogger(log *mylog.MyLog) RunnerConfigFn
type Settings ¶ added in v0.16.0
type Settings struct { Providers map[string]ProviderSettings // Registered providers Destinations map[string]string // Mapping of destination path WatchList []*matcher.MatchRequest // Slice of show matchers }
Settings hold application global settings
Click to show internal directories.
Click to hide internal directories.