-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update rust polaris-spec (#55)
- Loading branch information
Showing
8 changed files
with
160 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
syntax = "proto3"; | ||
|
||
package v1; | ||
|
||
import "service.proto"; | ||
|
||
option go_package = "github.com/polarismesh/specification/source/go/api/v1/service_manage"; | ||
option java_package = "com.tencent.polaris.specification.api.v1.service.manage"; | ||
|
||
message HeartbeatRecord { | ||
string instanceId = 1 [ json_name = "instance_id" ]; | ||
reserved 2 to 5; | ||
int64 lastHeartbeatSec = 6 [ json_name = "last_heartbeat_sec" ]; | ||
bool exist = 7 [ json_name = "exist" ]; | ||
} | ||
|
||
message InstanceHeartbeat { | ||
string instanceId = 1 [ json_name = "instance_id" ]; | ||
string service = 2 [ json_name = "service" ]; | ||
string namespace = 3 [ json_name = "namespace" ]; | ||
string host = 4 [ json_name = "host" ]; | ||
uint32 port = 5 [ json_name = "port" ]; | ||
} | ||
|
||
message HeartbeatsRequest { | ||
repeated InstanceHeartbeat heartbeats = 1 [ json_name = "heartbeats" ]; | ||
} | ||
|
||
message HeartbeatsResponse { | ||
} | ||
|
||
message GetHeartbeatsRequest { | ||
repeated string instanceIds = 1 [ json_name = "instance_ids" ]; | ||
} | ||
|
||
message GetHeartbeatsResponse { | ||
repeated HeartbeatRecord records = 1 [ json_name = "records" ]; | ||
} | ||
|
||
message DelHeartbeatsRequest { | ||
repeated string instanceIds = 1 [ json_name = "instance_ids" ]; | ||
} | ||
|
||
message DelHeartbeatsResponse { | ||
uint32 code = 1; | ||
string info = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
pub mod v1 { | ||
// The name "messages" corresponds with the `package` name in the `.proto` | ||
// include!(concat!(env!("OUT_DIR"), "/v1.rs")); | ||
include!("v1.rs"); | ||
pub mod v1; | ||
|
||
#[test] | ||
fn it_works() { | ||
println!("ok"); | ||
let r = v1::ConfigSimpleResponse { | ||
code: Some(0), | ||
info: Some("success".to_string()), | ||
}; | ||
|
||
println!("{:?}", r); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters