Documentation ¶
Index ¶
- Constants
- Variables
- func GetMessage(idx int64, units *progress.Units) string
- func Hash(path string) (ret string, err error)
- func IsDirectory(path string) (bool, error)
- func ProgressBar(x, y int64, desc string) string
- func ScaleBar(from, to, sum int) string
- type TorrentManager
- func (tm *TorrentManager) AddLocalSeedFile(ih string) bool
- func (tm *TorrentManager) Candidate() int
- func (tm *TorrentManager) Close() error
- func (tm *TorrentManager) Congress() int
- func (tm *TorrentManager) Dropping(ih string) error
- func (tm *TorrentManager) ExistsOrActive(ctx context.Context, ih string, rawSize uint64) (bool, uint64, mclock.AbsTime, error)
- func (tm *TorrentManager) GetFile(ctx context.Context, infohash, subpath string) (data []byte, mu *event.TypeMux, err error)
- func (tm *TorrentManager) IsDownloading(ih string) bool
- func (tm *TorrentManager) IsPending(ih string) bool
- func (tm *TorrentManager) IsSeeding(ih string) bool
- func (tm *TorrentManager) ListAllTorrents() map[string]map[string]int
- func (tm *TorrentManager) LocalPort() int
- func (tm *TorrentManager) Metrics() time.Duration
- func (tm *TorrentManager) Nominee() int
- func (tm *TorrentManager) PauseLocalSeedFile(ih string) error
- func (tm *TorrentManager) Pending(t *caffe.Torrent) error
- func (tm *TorrentManager) ResumeLocalSeedFile(ih string) error
- func (tm *TorrentManager) Running(t *caffe.Torrent) error
- func (tm *TorrentManager) Search(ctx context.Context, hex string, request uint64) error
- func (tm *TorrentManager) Seeding(t *caffe.Torrent) error
- func (tm *TorrentManager) Start() (err error)
Constants ¶
View Source
const ( ProgressBarLen = 10 ScaleBarLen = 10 )
View Source
const ( TORRENT = "torrent" SEED_PRE = "s-" )
Variables ¶
View Source
var ( // ErrInactiveTorrent is for torrent should be actived ErrInactiveTorrent = errors.New("torrent is inactive") //ErrUnfinished is for the file not downloaded ErrUnfinished = errors.New("download not completed") ErrTorrentNotFound = errors.New("torrent not found") ErrInvalidRawSize = errors.New("invalid raw size") )
Functions ¶
func IsDirectory ¶
func ProgressBar ¶
Types ¶
type TorrentManager ¶
type TorrentManager struct { //boostFetcher *BoostDataFetcher DataDir string TmpDataDir string Updates time.Duration // contains filtered or unexported fields }
func NewTorrentManager ¶
func (*TorrentManager) AddLocalSeedFile ¶
func (tm *TorrentManager) AddLocalSeedFile(ih string) bool
can only call by fs.go: 'SeedingLocal()'
func (*TorrentManager) Candidate ¶
func (tm *TorrentManager) Candidate() int
func (*TorrentManager) Close ¶
func (tm *TorrentManager) Close() error
func (*TorrentManager) Congress ¶
func (tm *TorrentManager) Congress() int
func (*TorrentManager) Dropping ¶ added in v1.0.55
func (tm *TorrentManager) Dropping(ih string) error
func (*TorrentManager) ExistsOrActive ¶ added in v1.0.55
func (*TorrentManager) IsDownloading ¶
func (tm *TorrentManager) IsDownloading(ih string) bool
func (*TorrentManager) IsPending ¶
func (tm *TorrentManager) IsPending(ih string) bool
func (*TorrentManager) IsSeeding ¶
func (tm *TorrentManager) IsSeeding(ih string) bool
func (*TorrentManager) ListAllTorrents ¶
func (tm *TorrentManager) ListAllTorrents() map[string]map[string]int
divide localSeed/on-chain Files return status of torrents
func (*TorrentManager) LocalPort ¶
func (tm *TorrentManager) LocalPort() int
func (*TorrentManager) Metrics ¶
func (tm *TorrentManager) Metrics() time.Duration
func (*TorrentManager) Nominee ¶
func (tm *TorrentManager) Nominee() int
func (*TorrentManager) PauseLocalSeedFile ¶
func (tm *TorrentManager) PauseLocalSeedFile(ih string) error
only files in map:localSeedFile can be paused!
func (*TorrentManager) Pending ¶ added in v1.0.55
func (tm *TorrentManager) Pending(t *caffe.Torrent) error
func (*TorrentManager) ResumeLocalSeedFile ¶
func (tm *TorrentManager) ResumeLocalSeedFile(ih string) error
only files in map:localSeedFile can be resumed!
func (*TorrentManager) Running ¶ added in v1.0.55
func (tm *TorrentManager) Running(t *caffe.Torrent) error
func (*TorrentManager) Seeding ¶ added in v1.0.55
func (tm *TorrentManager) Seeding(t *caffe.Torrent) error
func (*TorrentManager) Start ¶
func (tm *TorrentManager) Start() (err error)
Click to show internal directories.
Click to hide internal directories.