Documentation ¶
Index ¶
- func CustomMin(i int, j int) int
- type CacheTorrentRequest
- type ContentClient
- func (contentclient *ContentClient) AddCacheTorrentRequest(tmpdappname string, tmppath string, tmpmagnet string)
- func (contentclient *ContentClient) AddMagnetWithDownloadDir(uri string, downloadDir string) (*torrent.Torrent, error)
- func (contentclient *ContentClient) CacheRawString(tmpdappname string, tmppath string, tmpfilename string, tmprawstring string)
- func (contentclient *ContentClient) CacheTorrent(tmpdappname string, tmppath string, tmpmagneturi string)
- func (contentclient *ContentClient) DeleteFileSystemObject(tmpdappname string, tmppath string) string
- func (contentclient *ContentClient) DropTorrent(tmpmagneturi string, tmpdappname string, tmpdirectory string, ...) string
- func (contentclient *ContentClient) GetTorrentDetails(tmpmagneturi string) string
- func (contentclient *ContentClient) Initcontentclient()
- func (contentclient *ContentClient) ProtorizeTorrentDurationPercentageInterval(tmpmagnet string, tmppath string, beginprioritizeddurationpercentage int, ...)
- func (contentclient *ContentClient) ProtorizeTorrentPiecesInterval(tmpmagnet string, tmppath string, beginprioritizedpiece int, ...)
- func (contentclient *ContentClient) ScanDirectory(tmpdappname string, tmppath string) string
- type TorrentDetails
- type TorrentFileInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CacheTorrentRequest ¶
var mainclient *torrent.Client
type ContentClient ¶
type ContentClient struct { ContentLocation string //ClosingChannel chan bool CacheTorrentRequestChannel chan CacheTorrentRequest // contains filtered or unexported fields }
func Newcontentclient ¶
func Newcontentclient(ctx context.Context, applocation string) *ContentClient
func (*ContentClient) AddCacheTorrentRequest ¶
func (contentclient *ContentClient) AddCacheTorrentRequest(tmpdappname string, tmppath string, tmpmagnet string)
func (*ContentClient) AddMagnetWithDownloadDir ¶
func (*ContentClient) CacheRawString ¶
func (contentclient *ContentClient) CacheRawString(tmpdappname string, tmppath string, tmpfilename string, tmprawstring string)
func (*ContentClient) CacheTorrent ¶
func (contentclient *ContentClient) CacheTorrent(tmpdappname string, tmppath string, tmpmagneturi string)
//////////////////
func (*ContentClient) DeleteFileSystemObject ¶ added in v0.2.6
func (contentclient *ContentClient) DeleteFileSystemObject(tmpdappname string, tmppath string) string
////////////////// //////////////////
func (*ContentClient) DropTorrent ¶
func (*ContentClient) GetTorrentDetails ¶
func (contentclient *ContentClient) GetTorrentDetails(tmpmagneturi string) string
func (*ContentClient) Initcontentclient ¶
func (contentclient *ContentClient) Initcontentclient()
func (*ContentClient) ProtorizeTorrentDurationPercentageInterval ¶
func (*ContentClient) ProtorizeTorrentPiecesInterval ¶
func (contentclient *ContentClient) ProtorizeTorrentPiecesInterval(tmpmagnet string, tmppath string, beginprioritizedpiece int, endprioritizedpiece int, cancelflag bool)
func (contentclient *ContentClient) ProtorizeTorrentAllPieces(tmpmagnet string, tmppath string) { tmpmagnetobj, perr := metainfo.ParseMagnetUri(tmpmagnet) if perr != nil { log.Println("Error ",perr) return } t, ok := contentclient.torrentclient.Torrent(tmpmagnetobj.InfoHash) if !ok { log.Println("Torrent not found ") return } files := t.Files() for _, filei := range files { if strings.Contains(filei.Path(), tmppath) {//tmppreviewfile == filei.Path() { firstpiece := int(filei.BeginPieceIndex()) lastpiece := int(filei.EndPieceIndex()) log.Println("Priority for ",firstpiece,lastpiece) t.DownloadPieces(firstpiece, lastpiece) t.CancelPieces(lastpiece, filei.EndPieceIndex()) } else { filei.SetPriority(torrent.PiecePriorityNone) } } }
func (*ContentClient) ScanDirectory ¶ added in v0.2.6
func (contentclient *ContentClient) ScanDirectory(tmpdappname string, tmppath string) string
type TorrentDetails ¶
type TorrentDetails struct { Magnet string // `json:"magnet"` Name string // `json:"name"` Nbpeers int // `json:"nbpeers"` FileInfoArray []TorrentFileInfo //interface{} `json:"name,omitempty"` }
type TorrentFileInfo ¶
Click to show internal directories.
Click to hide internal directories.