Documentation
¶
Index ¶
- Constants
- Variables
- func HLSPlaylistDive(rootPath string, loader fileLoader, processor fileProcessor) (int64, error)
- func PoolDownload(d Downloadable) *dispatcher.Result
- type CachedVideo
- type Client
- type Configuration
- func (c *Configuration) CacheSize(size int64) *Configuration
- func (c *Configuration) HTTPClient(httpClient HTTPRequester) *Configuration
- func (c *Configuration) ItemsToPrune(i uint32) *Configuration
- func (c *Configuration) LogLevel(l int) *Configuration
- func (c *Configuration) Server(server string) *Configuration
- func (c *Configuration) VideoPath(videoPath string) *Configuration
- type Downloadable
- type HLSStream
- type HTTPRequester
- type Progress
Constants ¶
View Source
const ( Dev = iota Prod )
View Source
const ( Downloading = iota DownloadDone Failed )
View Source
const (
MasterPlaylistName = "master.m3u8"
)
Variables ¶
View Source
var ( TranscodedCacheSizeBytes = promauto.NewGauge(prometheus.GaugeOpts{ Name: "transcoded_cache_size_bytes", }) TranscodedCacheItemsCount = promauto.NewGauge(prometheus.GaugeOpts{ Name: "transcoded_cache_items_count", }) TranscodedResult = promauto.NewCounterVec(prometheus.CounterOpts{ Name: "transcoded_request_result", }, []string{"type"}) )
View Source
var ErrAlreadyDownloading = errors.New("video is already downloading")
ErrAlreadyDownloading when returned means that video retrieval is already underway and nothing needs to be done at this time.
Functions ¶
func HLSPlaylistDive ¶ added in v0.5.0
HLSPlaylistDive processes HLS streams, calling `load` to load and `process` for each master/child playlists and all the files they reference.
func PoolDownload ¶ added in v0.6.0
func PoolDownload(d Downloadable) *dispatcher.Result
Types ¶
type CachedVideo ¶
type CachedVideo struct {
// contains filtered or unexported fields
}
func (*CachedVideo) DirName ¶
func (v *CachedVideo) DirName() string
func (*CachedVideo) Size ¶
func (v *CachedVideo) Size() int64
type Client ¶
type Client struct { *Configuration // contains filtered or unexported fields }
func New ¶
func New(cfg *Configuration) Client
func (Client) CacheVideo ¶
func (Client) Get ¶
func (c Client) Get(kind, lbryURL, sdHash string) (*CachedVideo, Downloadable)
Get returns either a cached video or downloadable instance for further processing.
func (Client) GetCachedVideo ¶
func (c Client) GetCachedVideo(sdHash string) *CachedVideo
type Configuration ¶
type Configuration struct {
// contains filtered or unexported fields
}
func Configure ¶
func Configure() *Configuration
func (*Configuration) CacheSize ¶
func (c *Configuration) CacheSize(size int64) *Configuration
CacheSize defines local disk cache size for downloaded transcoded videos.
func (*Configuration) HTTPClient ¶
func (c *Configuration) HTTPClient(httpClient HTTPRequester) *Configuration
func (*Configuration) ItemsToPrune ¶ added in v0.5.9
func (c *Configuration) ItemsToPrune(i uint32) *Configuration
ItemsToPrune defines how many items to prune during cache cleanup
func (*Configuration) LogLevel ¶ added in v0.6.1
func (c *Configuration) LogLevel(l int) *Configuration
LogLevel sets verbosity of logging. `Dev` outputs a lot of debugging info, `Prod` is more restrained.
func (*Configuration) Server ¶
func (c *Configuration) Server(server string) *Configuration
Server sets transcoder server API address.
func (*Configuration) VideoPath ¶
func (c *Configuration) VideoPath(videoPath string) *Configuration
Server sets transcoder server API address.
type Downloadable ¶
type HTTPRequester ¶
Click to show internal directories.
Click to hide internal directories.