client

package
v0.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2021 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MasterPlaylistName = "master.m3u8"
)

Variables

This section is empty.

Functions

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 (c Client) CacheVideo(path string, size int64)

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

func (Client) RestoreCache

func (c Client) RestoreCache() (int64, error)

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 Downloadable interface {
	Download() error
	Progress() <-chan Progress
}

type HLSStream

type HLSStream struct {
	URL string

	SDHash string
	// contains filtered or unexported fields
}

func (HLSStream) DirName

func (s HLSStream) DirName() string

func (HLSStream) Download

func (s HLSStream) Download() error

func (HLSStream) LocalPath

func (s HLSStream) LocalPath() string

func (HLSStream) Progress

func (s HLSStream) Progress() <-chan Progress

func (HLSStream) SafeURL

func (s HLSStream) SafeURL() string

type HTTPRequester

type HTTPRequester interface {
	Do(req *http.Request) (res *http.Response, err error)
}

type Progress

type Progress struct {
	Error       error
	Stage       int
	Done        bool
	BytesLoaded int64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL