66 lines
1.8 KiB
Protocol Buffer
66 lines
1.8 KiB
Protocol Buffer
/*
|
|
* Copyright 2020 The Dragonfly Authors
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
syntax = "proto3";
|
|
|
|
package dfdaemon;
|
|
|
|
import "pkg/rpc/base/base.proto";
|
|
import "google/protobuf/empty.proto";
|
|
|
|
option go_package = "d7y.io/dragonfly/v2/pkg/rpc/dfdaemon";
|
|
|
|
message DownRequest{
|
|
// identify one downloading, the framework will fill it automatically
|
|
string uuid = 1;
|
|
// download file from the url, not only for http
|
|
string url = 2;
|
|
// pieces will be written to output path directly,
|
|
// at the same time, dfdaemon workspace also makes soft link to the output
|
|
string output = 3;
|
|
// timeout duration
|
|
int64 timeout = 4;
|
|
// rate limit in bytes per second
|
|
double limit = 5;
|
|
bool disable_back_source = 6;
|
|
base.UrlMeta url_meta = 7;
|
|
// p2p/cdn/source
|
|
string pattern = 8;
|
|
// call system
|
|
string callsystem = 9;
|
|
// user id
|
|
int64 uid = 10;
|
|
// group id
|
|
int64 gid = 11;
|
|
}
|
|
|
|
message DownResult{
|
|
string task_id = 2;
|
|
string peer_id = 3;
|
|
uint64 completed_length = 4;
|
|
bool done = 5;
|
|
}
|
|
|
|
// Daemon Client RPC Service
|
|
service Daemon{
|
|
// Trigger client to download file
|
|
rpc Download(DownRequest) returns(stream DownResult);
|
|
// Get piece tasks from other peers
|
|
rpc GetPieceTasks(base.PieceTaskRequest)returns(base.PiecePacket);
|
|
// Check daemon health
|
|
rpc CheckHealth(google.protobuf.Empty)returns(google.protobuf.Empty);
|
|
}
|