Documentation ¶
Index ¶
- func GetLargestFile(t *torrent.Torrent) *torrent.File
- func GetVideoFile(t *torrent.Torrent, episode int) (*torrent.File, error)
- func TorrentPercentage(t *torrent.Torrent) float64
- type Client
- func (c *Client) AddMagnet(magnet string) (*torrent.Torrent, error)
- func (c *Client) AddTorrent(tor string) (*torrent.Torrent, error)
- func (c *Client) AddTorrentFile(file string) (*torrent.Torrent, error)
- func (c *Client) AddTorrentURL(url string) (*torrent.Torrent, error)
- func (c *Client) Close() (errs []error)
- func (c *Client) DownloadTorrent(torrent string) error
- func (c *Client) DropTorrent(t *torrent.Torrent)
- func (c *Client) FindByInfoHhash(infoHash string) (*torrent.Torrent, error)
- func (c *Client) Init() error
- func (c *Client) ServeTorrent(t *torrent.Torrent, episode int) string
- func (c *Client) ServeTorrents(ctx context.Context, torrents []*torrent.Torrent)
- func (c *Client) ShowTorrents() []*torrent.Torrent
- func (c *Client) StartServer()
- type FileEntry
- type SeekableContent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLargestFile ¶
Get largest file inside of a Torrent
func TorrentPercentage ¶
Types ¶
type Client ¶
type Client struct { // client / project name, will be the default directory name Name string // directory to download torrents to DataDir string // Seed or no Seed bool // Port to stream torrents on Port string // Port to stream torrents on TorrentPort int // Default torrent client options TorrentClient *torrent.Client // torrents Torrents []*torrent.Torrent // Disable IPV6 DisableIPV6 bool // contains filtered or unexported fields }
func (*Client) AddTorrent ¶
generic add torrent function
func (*Client) AddTorrentFile ¶
func (*Client) DownloadTorrent ¶
func (*Client) DropTorrent ¶
func (*Client) FindByInfoHhash ¶
look through the torrent files the client is handling and return a torrent with a matching info hash
func (*Client) ServeTorrent ¶
Generate a link that can be used with the default clients server to play a torrent that is already loaded into the client
func (*Client) ServeTorrents ¶
func (*Client) ShowTorrents ¶
returns a slice of loaded torrents or nil
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.
Click to show internal directories.
Click to hide internal directories.