stream

package
v0.0.0-...-473f5cf Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package stream is responsible for creating streams from URLs and retrieving any relevant data such as file type

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrMediaTypeUnsupported is the error for an unsupported media type being detected
	ErrMediaTypeUnsupported = errors.New("This media type is not supported by ep, yet")
)

Functions

This section is empty.

Types

type File

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

File contains the information of the file to be streamed, and methods to begin streaming

func FromURL

func FromURL(url string) File

FromURL creates a stream File info object from the given file URL

func (File) GetDecoder

func (f File) GetDecoder() (player.DecodeFunc, error)

GetDecoder returns the audio decoder function for the data type detected. This function first tries to detect the data type, then returns a decode function or an error.

func (*File) GetStream

func (f *File) GetStream() (io.ReadCloser, error)

GetStream starts streaming the file and returns the ReadCloser for the stream data

Jump to

Keyboard shortcuts

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