Documentation
¶
Index ¶
Constants ¶
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 SetLogger ¶
func SetLogger(l *zap.SugaredLogger)
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) 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.