Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrSeedXORLeech = errors.New("can either seed or leech, but not both at the same time")
)
View Source
var (
ErrStartingTrackFailed = errors.New("starting track failed")
)
Functions ¶
This section is empty.
Types ¶
type FileLeecher ¶
type FileLeecher struct {
// contains filtered or unexported fields
}
func NewFileLeecher ¶
func NewFileLeecher( ctx context.Context, local backend.Backend, remote *services.SeederRemote, options *LeecherOptions, hooks *LeecherHooks, serverOptions *server.Options, clientOptions *client.Options, ) *FileLeecher
func (*FileLeecher) Close ¶
func (l *FileLeecher) Close() error
func (*FileLeecher) Open ¶
func (l *FileLeecher) Open() error
func (*FileLeecher) Release ¶
func (l *FileLeecher) Release() ( *mount.DirectPathMount, chan error, *sync.WaitGroup, string, *os.File, )
func (*FileLeecher) Wait ¶
func (l *FileLeecher) Wait() error
type FileMigrator ¶
type FileMigrator struct {
// contains filtered or unexported fields
}
func NewFileMigrator ¶
func NewFileMigrator( ctx context.Context, local backend.Backend, options *MigratorOptions, hooks *MigratorHooks, serverOptions *server.Options, clientOptions *client.Options, ) *FileMigrator
func (*FileMigrator) Close ¶
func (s *FileMigrator) Close() error
func (*FileMigrator) Leech ¶
func (s *FileMigrator) Leech( remote *services.SeederRemote, ) ( finalize func() ( seed func() ( svc *services.SeederService, err error, ), file *os.File, err error, ), err error, )
func (*FileMigrator) Seed ¶
func (s *FileMigrator) Seed() ( file *os.File, svc *services.SeederService, err error, )
func (*FileMigrator) Wait ¶
func (s *FileMigrator) Wait() error
type FileSeeder ¶
type FileSeeder struct {
// contains filtered or unexported fields
}
func NewFileSeeder ¶
func NewFileSeeder( local backend.Backend, options *SeederOptions, hooks *SeederHooks, serverOptions *server.Options, clientOptions *client.Options, ) *FileSeeder
func NewFileSeederFromLeecher ¶
func NewFileSeederFromLeecher( local backend.Backend, options *SeederOptions, hooks *SeederHooks, dev *mount.DirectPathMount, errs chan error, wg *sync.WaitGroup, devicePath string, serverFile *os.File, deviceFile *os.File, ) *FileSeeder
func (*FileSeeder) Close ¶
func (s *FileSeeder) Close() error
func (*FileSeeder) Open ¶
func (s *FileSeeder) Open() (*os.File, *services.SeederService, error)
func (*FileSeeder) Wait ¶
func (s *FileSeeder) Wait() error
type LeecherHooks ¶
type LeecherOptions ¶
type MigratorHooks ¶
type MigratorOptions ¶
type PathLeecher ¶
type PathLeecher struct {
// contains filtered or unexported fields
}
func NewPathLeecher ¶
func NewPathLeecher( ctx context.Context, local backend.Backend, remote *services.SeederRemote, options *LeecherOptions, hooks *LeecherHooks, serverOptions *server.Options, clientOptions *client.Options, ) *PathLeecher
func (*PathLeecher) Close ¶
func (l *PathLeecher) Close() error
func (*PathLeecher) Finalize ¶
func (l *PathLeecher) Finalize() (string, error)
func (*PathLeecher) Open ¶
func (l *PathLeecher) Open() (int64, error)
func (*PathLeecher) Release ¶
func (l *PathLeecher) Release() ( *mount.DirectPathMount, chan error, *sync.WaitGroup, string, *os.File, )
func (*PathLeecher) Wait ¶
func (l *PathLeecher) Wait() error
type PathMigrator ¶
type PathMigrator struct {
// contains filtered or unexported fields
}
func NewPathMigrator ¶
func NewPathMigrator( ctx context.Context, local backend.Backend, options *MigratorOptions, hooks *MigratorHooks, serverOptions *server.Options, clientOptions *client.Options, ) *PathMigrator
func (*PathMigrator) Close ¶
func (s *PathMigrator) Close() error
func (*PathMigrator) Leech ¶
func (s *PathMigrator) Leech( remote *services.SeederRemote, ) ( finalize func() ( seed func() ( svc *services.SeederService, err error, ), path string, err error, ), size int64, err error, )
func (*PathMigrator) Seed ¶
func (s *PathMigrator) Seed() ( path string, size int64, svc *services.SeederService, err error, )
func (*PathMigrator) Wait ¶
func (s *PathMigrator) Wait() error
type PathSeeder ¶
type PathSeeder struct {
// contains filtered or unexported fields
}
func NewPathSeeder ¶
func NewPathSeeder( local backend.Backend, options *SeederOptions, hooks *SeederHooks, serverOptions *server.Options, clientOptions *client.Options, ) *PathSeeder
func NewPathSeederFromLeecher ¶
func NewPathSeederFromLeecher( local backend.Backend, options *SeederOptions, hooks *SeederHooks, dev *mount.DirectPathMount, errs chan error, wg *sync.WaitGroup, devicePath string, serverFile *os.File, ) *PathSeeder
func (*PathSeeder) Close ¶
func (s *PathSeeder) Close() error
func (*PathSeeder) Open ¶
func (s *PathSeeder) Open() (string, int64, *services.SeederService, error)
func (*PathSeeder) Wait ¶
func (s *PathSeeder) Wait() error
type SeederHooks ¶
type SeederOptions ¶
type SliceLeecher ¶
type SliceLeecher struct {
// contains filtered or unexported fields
}
func NewSliceLeecher ¶
func NewSliceLeecher( ctx context.Context, local backend.Backend, remote *services.SeederRemote, options *LeecherOptions, hooks *LeecherHooks, serverOptions *server.Options, clientOptions *client.Options, ) *SliceLeecher
func (*SliceLeecher) Close ¶
func (l *SliceLeecher) Close() error
func (*SliceLeecher) Finalize ¶
func (l *SliceLeecher) Finalize() ([]byte, error)
func (*SliceLeecher) Open ¶
func (l *SliceLeecher) Open() error
func (*SliceLeecher) Release ¶
func (l *SliceLeecher) Release() ( *mount.DirectPathMount, chan error, *sync.WaitGroup, string, *os.File, )
func (*SliceLeecher) Wait ¶
func (l *SliceLeecher) Wait() error
type SliceMigrator ¶
type SliceMigrator struct {
// contains filtered or unexported fields
}
func NewSliceMigrator ¶
func NewSliceMigrator( ctx context.Context, local backend.Backend, options *MigratorOptions, hooks *MigratorHooks, serverOptions *server.Options, clientOptions *client.Options, ) *SliceMigrator
func (*SliceMigrator) Close ¶
func (s *SliceMigrator) Close() error
func (*SliceMigrator) Leech ¶
func (s *SliceMigrator) Leech( remote *services.SeederRemote, ) ( finalize func() ( seed func() ( svc *services.SeederService, err error, ), slice []byte, err error, ), err error, )
func (*SliceMigrator) Seed ¶
func (s *SliceMigrator) Seed() ( slice []byte, svc *services.SeederService, err error, )
func (*SliceMigrator) Wait ¶
func (s *SliceMigrator) Wait() error
type SliceSeeder ¶
type SliceSeeder struct {
// contains filtered or unexported fields
}
func NewSliceSeeder ¶
func NewSliceSeeder( local backend.Backend, options *SeederOptions, hooks *SeederHooks, serverOptions *server.Options, clientOptions *client.Options, ) *SliceSeeder
func NewSliceSeederFromLeecher ¶
func NewSliceSeederFromLeecher( local backend.Backend, options *SeederOptions, hooks *SeederHooks, dev *mount.DirectPathMount, errs chan error, wg *sync.WaitGroup, devicePath string, releasedServerFile *os.File, deviceSlice []byte, ) *SliceSeeder
func (*SliceSeeder) Close ¶
func (s *SliceSeeder) Close() error
func (*SliceSeeder) Open ¶
func (s *SliceSeeder) Open() ([]byte, *services.SeederService, error)
func (*SliceSeeder) Wait ¶
func (s *SliceSeeder) Wait() error
Click to show internal directories.
Click to hide internal directories.