Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientConfig ¶
type ClientConfig struct { TorrentPath string Port int TorrentPort int Seed bool TCP bool MaxConnections int }
ClientConfig specifies the behaviour of a GoFlix.
func DefaultClientConfig ¶
func DefaultClientConfig() ClientConfig
type ClientError ¶
ClientError formats errors coming from the GoFlix.
func (ClientError) Error ¶
func (clientError ClientError) Error() string
type GoFlix ¶
type GoFlix struct { Client *torrent.Client Torrent *torrent.Torrent Progress int64 Uploaded int64 Config *ClientConfig }
GoFlix manages the torrent downloading.
func New ¶
func New(cfg *ClientConfig) (*GoFlix, error)
NewClient creates a new torrent GoFlix based on a magnet or a torrent file. If the torrent file is on http, we try downloading it.
func (*GoFlix) FileReader ¶
func (c *GoFlix) FileReader() (io.ReadSeeker, error)
func (*GoFlix) GetLargestFile ¶
func (*GoFlix) HandlerFunc ¶
func (c *GoFlix) HandlerFunc() http.HandlerFunc
GetFile is an http handler to serve the biggest file managed by the GoFlix.
func (*GoFlix) Percentage ¶
func (*GoFlix) ReadyForPlayback ¶
ReadyForPlayback checks if the torrent is ready for playback or not. We wait until 5% of the torrent to start playing.
Click to show internal directories.
Click to hide internal directories.