Versions in this module Expand all Collapse all v1 v1.0.0 Sep 20, 2023 Changes in this version + const ListSeparator + const Separator + var ErrSkip = fmt.Errorf("skip") + var SkipDir error = fs.SkipDir + var Trackers = [][]string + func AddTorrentFiles(snapDir string, torrentClient *torrent.Client) error + func AllTorrentFiles(dir string) ([]string, error) + func AllTorrentPaths(dir string) ([]string, error) + func BuildTorrentFilesIfNeed(ctx context.Context, snapDir string) ([]string, error) + func BuildTorrentIfNeed(ctx context.Context, fName, root string) (torrentFilePath string, err error) + func Clean(path string) string + func CreateMetaInfo(info *metainfo.Info, mi *metainfo.MetaInfo) (*metainfo.MetaInfo, error) + func CreateTorrentFileFromInfo(root string, info *metainfo.Info, mi *metainfo.MetaInfo) (err error) + func CreateTorrentFileIfNotExists(root string, info *metainfo.Info, mi *metainfo.MetaInfo) error + func CreateTorrentFromMetaInfo(root string, info *metainfo.Info, mi *metainfo.MetaInfo) error + func FromSlash(path string) string + func HasPrefix(p, prefix string) bool — windows/amd64 + func IsAbs(path string) (b bool) — windows/amd64 + func IsAbs(path string) bool — darwin/amd64, js/wasm, linux/amd64 + func IsLocal(path string) bool + func Join(elem ...string) string + func NewMdbxPieceCompletion(db kv.RwDB) (ret storage.PieceCompletion, err error) + func Proto2InfoHash(in *prototypes.H160) metainfo.Hash + type AggStats struct + BytesCompleted uint64 + BytesDownload uint64 + BytesTotal uint64 + BytesUpload uint64 + Completed bool + ConnectionsTotal uint64 + DownloadRate uint64 + DroppedCompleted uint64 + DroppedTotal uint64 + FilesTotal int32 + MetadataReady int32 + PeersUnique int32 + Progress float32 + UploadRate uint64 + type Downloader struct + func New(ctx context.Context, cfg *downloadercfg.Cfg) (*Downloader, error) + func (d *Downloader) AddInfoHashAsMagnetLink(ctx context.Context, infoHash metainfo.Hash, name string) error + func (d *Downloader) AddNewSeedableFile(ctx context.Context, name string) error + func (d *Downloader) Close() + func (d *Downloader) MainLoopInBackground(silent bool) + func (d *Downloader) PeerID() []byte + func (d *Downloader) ReCalcStats(interval time.Duration) + func (d *Downloader) SnapDir() string + func (d *Downloader) Stats() AggStats + func (d *Downloader) StopSeeding(hash metainfo.Hash) error + func (d *Downloader) TorrentClient() *torrent.Client + func (d *Downloader) VerifyData(ctx context.Context) error + type GrpcServer struct + func NewGrpcServer(d *Downloader) (*GrpcServer, error) + func (s *GrpcServer) Download(ctx context.Context, request *proto_downloader.DownloadRequest) (*emptypb.Empty, error) + func (s *GrpcServer) Stats(ctx context.Context, request *proto_downloader.StatsRequest) (*proto_downloader.StatsReply, error) + func (s *GrpcServer) Verify(ctx context.Context, request *proto_downloader.VerifyRequest) (*emptypb.Empty, error) + type WalkFunc func(path string, info fs.FileInfo, err error) error + type WebSeeds struct + func (d *WebSeeds) Discover(ctx context.Context, urls []*url.URL, files []string) + func (d *WebSeeds) GetByFileNames() snaptype.WebSeeds + func (d *WebSeeds) SetByFileNames(l snaptype.WebSeeds)