worker

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2022 License: MIT Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWorker

func NewWorker(ctx context.Context) swarm.Swarm

Types

type Worker

type Worker struct {
	Version     string
	WDFreeSpace uint64
	Torrents    map[string]*deluge.Torrent
	// contains filtered or unexported fields
}

func (*Worker) Bootstrap

func (m *Worker) Bootstrap() (e error)

func (*Worker) ForceReannounce

func (*Worker) ForceReannounce(string) error

func (*Worker) GetConnectedWorkers

func (*Worker) GetConnectedWorkers() (_ map[string]*swarm.SwarmWorker)

func (*Worker) IsMaster

func (*Worker) IsMaster() bool

func (*Worker) RemoveTorrent

func (*Worker) RemoveTorrent(string, string, string, ...bool) (uint64, uint64, error)

func (*Worker) RequestFreeSpaceFromWorker

func (*Worker) RequestFreeSpaceFromWorker(string) (uint64, error)

func (*Worker) RequestTorrentsFromWorker

func (*Worker) RequestTorrentsFromWorker(string) ([]*deluge.Torrent, error)

func (*Worker) SaveTorrentFile

func (*Worker) SaveTorrentFile(string, string, *[]byte) (int64, error)

type WorkerService

type WorkerService struct {
	pb.UnimplementedWorkerServiceServer
	// contains filtered or unexported fields
}

func NewWorkerService

func NewWorkerService(w *Worker) *WorkerService

func (*WorkerService) DropTorrent

func (m *WorkerService) DropTorrent(ctx context.Context, req *pb.TorrentDropRequest) (_ *pb.TorrentDropReply, _ error)

func (*WorkerService) ForceReannounce

func (m *WorkerService) ForceReannounce(ctx context.Context, _ *emptypb.Empty) (_ *emptypb.Empty, e error)

func (*WorkerService) GetSystemFreeSpace

func (m *WorkerService) GetSystemFreeSpace(ctx context.Context, _ *emptypb.Empty) (_ *pb.SystemSpaceReply, _ error)

func (*WorkerService) GetTorrentScore

func (m *WorkerService) GetTorrentScore(ctx context.Context, req *pb.TorrentScoreRequest) (_ *pb.TorrentScoreReply, _ error)

func (*WorkerService) GetTorrents

func (m *WorkerService) GetTorrents(ctx context.Context, _ *emptypb.Empty) (_ *pb.TorrentsReply, _ error)

func (*WorkerService) Init

func (m *WorkerService) Init(ctx context.Context, _ *emptypb.Empty) (*pb.InitReply, error)

func (*WorkerService) Ping

func (*WorkerService) SaveTorrentFile

func (m *WorkerService) SaveTorrentFile(ctx context.Context, req *pb.TFileSaveRequest) (_ *pb.TFileSaveReply, _ error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL