Documentation ¶
Index ¶
- func AddTorrentDB(torr *Torrent)
- func DropTorrent(hashHex string)
- func InitApiHelper(bt *BTServer)
- func ListTorrentsDB() map[metainfo.Hash]*Torrent
- func Preload(torr *Torrent, index int)
- func RemTorrent(hashHex string)
- func RemTorrentDB(hash metainfo.Hash)
- func SaveTorrentToDB(torr *Torrent)
- func SetDefSettings()
- func SetSettings(set *sets.BTSets)
- func Shutdown()
- func WriteStatus(w io.Writer)
- type BTServer
- type Torrent
- func AddTorrent(spec *torrent.TorrentSpec, title, poster string, data string) (*Torrent, error)
- func GetTorrent(hashHex string) *Torrent
- func GetTorrentDB(hash metainfo.Hash) *Torrent
- func ListTorrent() []*Torrent
- func LoadTorrent(tor *Torrent) *Torrent
- func NewTorrent(spec *torrent.TorrentSpec, bt *BTServer) (*Torrent, error)
- func SetTorrent(hashHex, title, poster, data string) *Torrent
- func (t *Torrent) AddExpiredTime(duration time.Duration)
- func (t *Torrent) CacheState() *cacheSt.CacheState
- func (t *Torrent) Close() bool
- func (t *Torrent) CloseReader(reader *torrstor.Reader)
- func (t *Torrent) Files() []*torrent.File
- func (t *Torrent) GetCache() *torrstor.Cache
- func (t *Torrent) GotInfo() bool
- func (t *Torrent) Hash() metainfo.Hash
- func (t *Torrent) Length() int64
- func (t *Torrent) NewReader(file *torrent.File) *torrstor.Reader
- func (t *Torrent) Preload(index int, size int64)
- func (t *Torrent) Status() *state.TorrentStatus
- func (t *Torrent) Stream(fileID int, req *http.Request, resp http.ResponseWriter) error
- func (t *Torrent) WaitInfo() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddTorrentDB ¶
func AddTorrentDB(torr *Torrent)
func DropTorrent ¶
func DropTorrent(hashHex string)
func InitApiHelper ¶
func InitApiHelper(bt *BTServer)
func ListTorrentsDB ¶
func RemTorrent ¶
func RemTorrent(hashHex string)
func RemTorrentDB ¶
func SaveTorrentToDB ¶
func SaveTorrentToDB(torr *Torrent)
func SetDefSettings ¶
func SetDefSettings()
func SetSettings ¶
func WriteStatus ¶
Types ¶
type BTServer ¶
type BTServer struct {
// contains filtered or unexported fields
}
func (*BTServer) Disconnect ¶
func (bt *BTServer) Disconnect()
type Torrent ¶
type Torrent struct { Title string Poster string Data string *torrent.TorrentSpec Stat state.TorrentStat Timestamp int64 Size int64 *torrent.Torrent DownloadSpeed float64 UploadSpeed float64 BytesReadUsefulData int64 BytesWrittenData int64 PreloadSize int64 PreloadedBytes int64 DurationSeconds float64 BitRate string // contains filtered or unexported fields }
func AddTorrent ¶
func GetTorrent ¶
func GetTorrentDB ¶
func ListTorrent ¶
func ListTorrent() []*Torrent
func LoadTorrent ¶
func NewTorrent ¶
func NewTorrent(spec *torrent.TorrentSpec, bt *BTServer) (*Torrent, error)
func SetTorrent ¶
func (*Torrent) AddExpiredTime ¶
func (*Torrent) CacheState ¶
func (t *Torrent) CacheState() *cacheSt.CacheState
func (*Torrent) CloseReader ¶
func (*Torrent) Status ¶
func (t *Torrent) Status() *state.TorrentStatus
Source Files ¶
Click to show internal directories.
Click to hide internal directories.