Versions in this module Expand all Collapse all v0 v0.1.1 Jul 30, 2024 v0.1.0 Nov 9, 2023 Changes in this version + var ErrSeedXORLeech = errors.New("can either seed or leech, but not both at the same time") + var ErrStartingTrackFailed = errors.New("starting track failed") + type FileLeecher struct + func NewFileLeecher(ctx context.Context, local backend.Backend, remote *services.SeederRemote, ...) *FileLeecher + func (l *FileLeecher) Close() error + func (l *FileLeecher) Finalize() (*os.File, error) + func (l *FileLeecher) Open() error + func (l *FileLeecher) Release() (*mount.DirectPathMount, chan error, *sync.WaitGroup, string, *os.File) + func (l *FileLeecher) Wait() error + type FileMigrator struct + func NewFileMigrator(ctx context.Context, local backend.Backend, options *MigratorOptions, ...) *FileMigrator + func (s *FileMigrator) Close() error + func (s *FileMigrator) Leech(remote *services.SeederRemote) (...) + func (s *FileMigrator) Seed() (file *os.File, svc *services.SeederService, err error) + func (s *FileMigrator) Wait() error + type FileSeeder struct + func NewFileSeeder(local backend.Backend, options *SeederOptions, hooks *SeederHooks, ...) *FileSeeder + func NewFileSeederFromLeecher(local backend.Backend, options *SeederOptions, hooks *SeederHooks, ...) *FileSeeder + func (s *FileSeeder) Close() error + func (s *FileSeeder) Open() (*os.File, *services.SeederService, error) + func (s *FileSeeder) Wait() error + type LeecherHooks struct + OnAfterSync func(dirtyOffsets []int64) error + OnBeforeClose func() error + OnChunkIsLocal func(off int64) error + type LeecherOptions struct + ChunkSize int64 + PullPriority func(off int64) int64 + PullWorkers int64 + Verbose bool + type MigratorHooks struct + OnAfterSync func(dirtyOffsets []int64) error + OnBeforeClose func() error + OnBeforeSync func() error + OnChunkIsLocal func(off int64) error + type MigratorOptions struct + ChunkSize int64 + MaxChunkSize int64 + PullPriority func(off int64) int64 + PullWorkers int64 + Verbose bool + type PathLeecher struct + func NewPathLeecher(ctx context.Context, local backend.Backend, remote *services.SeederRemote, ...) *PathLeecher + func (l *PathLeecher) Close() error + func (l *PathLeecher) Finalize() (string, error) + func (l *PathLeecher) Open() (int64, error) + func (l *PathLeecher) Release() (*mount.DirectPathMount, chan error, *sync.WaitGroup, string, *os.File) + func (l *PathLeecher) Wait() error + type PathMigrator struct + func NewPathMigrator(ctx context.Context, local backend.Backend, options *MigratorOptions, ...) *PathMigrator + func (s *PathMigrator) Close() error + func (s *PathMigrator) Leech(remote *services.SeederRemote) (...) + func (s *PathMigrator) Seed() (path string, size int64, svc *services.SeederService, err error) + func (s *PathMigrator) Wait() error + type PathSeeder struct + func NewPathSeeder(local backend.Backend, options *SeederOptions, hooks *SeederHooks, ...) *PathSeeder + func NewPathSeederFromLeecher(local backend.Backend, options *SeederOptions, hooks *SeederHooks, ...) *PathSeeder + func (s *PathSeeder) Close() error + func (s *PathSeeder) Open() (string, int64, *services.SeederService, error) + func (s *PathSeeder) Wait() error + type SeederHooks struct + OnBeforeClose func() error + OnBeforeSync func() error + type SeederOptions struct + ChunkSize int64 + MaxChunkSize int64 + Verbose bool + type SliceLeecher struct + func NewSliceLeecher(ctx context.Context, local backend.Backend, remote *services.SeederRemote, ...) *SliceLeecher + func (l *SliceLeecher) Close() error + func (l *SliceLeecher) Finalize() ([]byte, error) + func (l *SliceLeecher) Open() error + func (l *SliceLeecher) Release() (*mount.DirectPathMount, chan error, *sync.WaitGroup, string, *os.File) + func (l *SliceLeecher) Wait() error + type SliceMigrator struct + func NewSliceMigrator(ctx context.Context, local backend.Backend, options *MigratorOptions, ...) *SliceMigrator + func (s *SliceMigrator) Close() error + func (s *SliceMigrator) Leech(remote *services.SeederRemote) (...) + func (s *SliceMigrator) Seed() (slice []byte, svc *services.SeederService, err error) + func (s *SliceMigrator) Wait() error + type SliceSeeder struct + func NewSliceSeeder(local backend.Backend, options *SeederOptions, hooks *SeederHooks, ...) *SliceSeeder + func NewSliceSeederFromLeecher(local backend.Backend, options *SeederOptions, hooks *SeederHooks, ...) *SliceSeeder + func (s *SliceSeeder) Close() error + func (s *SliceSeeder) Open() ([]byte, *services.SeederService, error) + func (s *SliceSeeder) Wait() error