54 lines
1.0 KiB
Protocol Buffer
54 lines
1.0 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package torrent;
|
|
|
|
service Torrents {
|
|
// Add a torrent from a magnet link 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);
|
|
}
|
|
|
|
message AddRequest {
|
|
string magnet = 1;
|
|
// Optional output directory override. Empty means use torad's default.
|
|
string output_dir = 2;
|
|
}
|
|
|
|
message AddResponse {
|
|
string id = 1;
|
|
}
|
|
|
|
message StatusRequest {
|
|
string id = 1;
|
|
}
|
|
|
|
message ListRequest {}
|
|
|
|
message ListResponse {
|
|
repeated TorrentStatus torrents = 1;
|
|
}
|
|
|
|
enum State {
|
|
STATE_UNSPECIFIED = 0;
|
|
PENDING = 1;
|
|
DOWNLOADING = 2;
|
|
PAUSED = 3;
|
|
FINISHED = 4;
|
|
ERROR = 5;
|
|
}
|
|
|
|
message TorrentStatus {
|
|
string id = 1;
|
|
string info_hash = 2;
|
|
string name = 3;
|
|
string source = 4;
|
|
string output_path = 5;
|
|
uint64 total_bytes = 6;
|
|
uint64 downloaded_bytes = 7;
|
|
State state = 8;
|
|
string error_message = 9;
|
|
}
|