Skip to content

Commit

Permalink
feat: add method SyncHost to service DfdaemonUpload (#431)
Browse files Browse the repository at this point in the history
Signed-off-by: baowj <[email protected]>
  • Loading branch information
baowj-678 authored Dec 31, 2024
1 parent af929d0 commit 190d05d
Show file tree
Hide file tree
Showing 9 changed files with 540 additions and 147 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dragonfly-api"
version = "2.1.0"
version = "2.1.1"
authors = ["Gaius <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand Down
366 changes: 225 additions & 141 deletions pkg/apis/dfdaemon/v2/dfdaemon.pb.go

Large diffs are not rendered by default.

122 changes: 122 additions & 0 deletions pkg/apis/dfdaemon/v2/dfdaemon.pb.validate.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions pkg/apis/dfdaemon/v2/dfdaemon.proto
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,14 @@ message DeletePersistentCacheTaskRequest {
string task_id = 1 [(validate.rules).string.min_len = 1];
}

// SyncHostRequest represents request of SyncHost.
message SyncHostRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Peer id.
string peer_id = 2 [(validate.rules).string.min_len = 1];
}

// DfdaemonUpload represents dfdaemon upload service.
service DfdaemonUpload {
// DownloadTask downloads task from p2p network.
Expand All @@ -219,6 +227,9 @@ service DfdaemonUpload {

// DeletePersistentCacheTask deletes persistent cache task from p2p network.
rpc DeletePersistentCacheTask(DeletePersistentCacheTaskRequest) returns(google.protobuf.Empty);

// SyncHost sync host info from parents.
rpc SyncHost(SyncHostRequest) returns (stream common.v2.Host);
}

// DfdaemonDownload represents dfdaemon download service.
Expand Down
65 changes: 65 additions & 0 deletions pkg/apis/dfdaemon/v2/dfdaemon_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions proto/dfdaemon.proto
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,14 @@ message DeletePersistentCacheTaskRequest {
string task_id = 1;
}

// SyncHostRequest represents request of SyncHost.
message SyncHostRequest {
// Host id.
string host_id = 1;
// Peer id.
string peer_id = 2;
}

// DfdaemonUpload represents upload service of dfdaemon.
service DfdaemonUpload{
// DownloadTask downloads task from p2p network.
Expand All @@ -206,6 +214,9 @@ service DfdaemonUpload{

// DeletePersistentCacheTask deletes persistent cache task from p2p network.
rpc DeletePersistentCacheTask(DeletePersistentCacheTaskRequest) returns(google.protobuf.Empty);

// SyncHost sync host info from parents.
rpc SyncHost(SyncHostRequest) returns (stream common.v2.Host);
}

// DfdaemonDownload represents download service of dfdaemon.
Expand Down
Binary file modified src/descriptor.bin
Binary file not shown.
Loading

0 comments on commit 190d05d

Please sign in to comment.