Add pause/resume, enchance tora-cli
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
version: v2
|
||||
plugins:
|
||||
- local: protoc-gen-prost
|
||||
out: ../crates/proto/src/generated
|
||||
opt:
|
||||
- file_descriptor_set
|
||||
- enable_type_names
|
||||
- local: protoc-gen-prost-serde
|
||||
out: ../crates/proto/src/generated
|
||||
- local: protoc-gen-tonic
|
||||
out: ../crates/proto/src/generated
|
||||
@@ -1,9 +0,0 @@
|
||||
version: v2
|
||||
modules:
|
||||
- path: .
|
||||
lint:
|
||||
use:
|
||||
- STANDARD
|
||||
breaking:
|
||||
use:
|
||||
- FILE
|
||||
+32
-1
@@ -3,12 +3,18 @@ syntax = "proto3";
|
||||
package torrent;
|
||||
|
||||
service Torrents {
|
||||
// Add a torrent from a magnet link and start downloading it.
|
||||
// Add a torrent from a magnet link or .torrent file and start downloading it.
|
||||
rpc Add(AddRequest) returns (AddResponse);
|
||||
// Get the current status of a single torrent.
|
||||
rpc Status(StatusRequest) returns (TorrentStatus);
|
||||
// List all torrents known to the daemon.
|
||||
rpc List(ListRequest) returns (ListResponse);
|
||||
// Remove a torrent from tracking.
|
||||
rpc Remove(RemoveRequest) returns (RemoveResponse);
|
||||
// Pause a downloading torrent.
|
||||
rpc Pause(PauseRequest) returns (PauseResponse);
|
||||
// Resume a paused torrent.
|
||||
rpc Resume(ResumeRequest) returns (ResumeResponse);
|
||||
}
|
||||
|
||||
message AddRequest {
|
||||
@@ -31,6 +37,25 @@ message ListResponse {
|
||||
repeated TorrentStatus torrents = 1;
|
||||
}
|
||||
|
||||
message RemoveRequest {
|
||||
string id = 1;
|
||||
bool delete_files = 2;
|
||||
}
|
||||
|
||||
message RemoveResponse {}
|
||||
|
||||
message PauseRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message PauseResponse {}
|
||||
|
||||
message ResumeRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message ResumeResponse {}
|
||||
|
||||
enum State {
|
||||
STATE_UNSPECIFIED = 0;
|
||||
PENDING = 1;
|
||||
@@ -50,4 +75,10 @@ message TorrentStatus {
|
||||
uint64 downloaded_bytes = 7;
|
||||
State state = 8;
|
||||
string error_message = 9;
|
||||
uint64 download_speed_bps = 10;
|
||||
uint64 eta_seconds = 11;
|
||||
uint64 uploaded_bytes = 12;
|
||||
uint64 upload_speed_bps = 13;
|
||||
uint32 peers = 14;
|
||||
uint32 seeds = 15;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user