Documentation ¶
Index ¶
- func BuildMagnet(infoHash string, title string) string
- type Client
- func (c *Client) AddTorrent(infoHash string) (err error)
- func (c *Client) GetFile(w http.ResponseWriter, r *http.Request)
- func (c *Client) MovieDelete(w http.ResponseWriter, r *http.Request)
- func (c *Client) MovieRequest(w http.ResponseWriter, r *http.Request)
- func (c *Client) Status(w http.ResponseWriter, r *http.Request)
- func (c *Client) TorrentStatus(w http.ResponseWriter, r *http.Request)
- type FileEntry
- type SeekableContent
- type Status
- type Torrent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildMagnet ¶
BuildMagnet builds a magnet link from an info hash and a static list of trackers.
Types ¶
type Client ¶
Client stores active Torrents and a reference to the BitTorrent client.
func (*Client) AddTorrent ¶
AddTorrent adds Torrent to the client. If the torrent is already added returns without error.
func (*Client) GetFile ¶
func (c *Client) GetFile(w http.ResponseWriter, r *http.Request)
GetFile is an http handler to serve the biggest file managed by the client.
func (*Client) MovieDelete ¶
func (c *Client) MovieDelete(w http.ResponseWriter, r *http.Request)
MovieDelete deletes a torrent identified by an info hash from the BitTorrent Client.
func (*Client) MovieRequest ¶
func (c *Client) MovieRequest(w http.ResponseWriter, r *http.Request)
MovieRequest adds a torrent identified by an info hash to the BitTorrent Client.
func (*Client) Status ¶
func (c *Client) Status(w http.ResponseWriter, r *http.Request)
Status serves a html with an overview of all active torrents.
func (*Client) TorrentStatus ¶
func (c *Client) TorrentStatus(w http.ResponseWriter, r *http.Request)
TorrentStatus returns download progress information about all active torrents.
type SeekableContent ¶
type SeekableContent interface { io.ReadSeeker io.Closer }
SeekableContent describes an io.ReadSeeker that can be closed as well.
func NewFileReader ¶
func NewFileReader(f *torrent.File) (SeekableContent, error)
NewFileReader sets up a torrent file for streaming reading.