downloader

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2015 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrStreamOffline       = errors.New("Stream offline")
	ErrTargetVideoNotFound = errors.New("Target not found")
)

Functions

func GetMetadataFileName

func GetMetadataFileName(fileName string) string

func WriteMetadata

func WriteMetadata(output io.Writer, metadata Metadata) (err error)

Types

type Chunk

type Chunk struct {
	URL  string
	Name string
	ID   int64
}

type Downloader

type Downloader struct {
	// contains filtered or unexported fields
}

func New

func New(name string, client HTTPClient) *Downloader

func (*Downloader) Download

func (d *Downloader) Download(stream Stream) error

func (Downloader) DownloadChunk

func (d Downloader) DownloadChunk(chunkURL string) error

func (Downloader) DownloadChunks

func (d Downloader) DownloadChunks(stream Stream) error

func (Downloader) Notify

func (d Downloader) Notify(message string)

func (*Downloader) Start

func (d *Downloader) Start()

type HTTPClient

type HTTPClient interface {
	Do(*http.Request) (*http.Response, error)
}

type Metadata

type Metadata struct {
	Title  string
	Author string
	Date   time.Time
}

func ReadMetadata

func ReadMetadata(input io.Reader) (metadata Metadata, err error)

type Stream

type Stream struct {
	Name string
	URL  string
}

Jump to

Keyboard shortcuts

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