Rough outline of Network introspection interface

This commit is contained in:
Milos Gajdos
2019-09-02 11:42:45 +01:00
parent 6c3631728b
commit bf53c16e4b
6 changed files with 255 additions and 38 deletions

View File

@@ -8,7 +8,7 @@ import "github.com/micro/go-micro/router/proto/router.proto";
service Network {
rpc ListRoutes(go.micro.router.Request) returns (go.micro.router.ListResponse) {};
rpc ListNodes(ListRequest) returns (ListResponse) {};
rpc ListNeighbours(ListRequest) returns (ListResponse) {};
rpc Neighbourhood(NeighbourhoodRequest) returns (NeighbourhoodResponse) {};
}
// Empty request
@@ -19,6 +19,24 @@ message ListResponse {
repeated Node nodes = 1;
}
// NeighbourhoodRequest is sent to query node neighbourhood
message NeighbourhoodRequest {
string id = 1;
}
// NeighbourhoodResponse contains node neighbourhood hierarchy
message NeighbourhoodResponse {
Neighbour neighbourhood = 1;
}
// Neighbourhood is node neighbourhood
message Neighbourhood {
// network node
Node node = 1;
// node neighbours
repeated Neighbour neighbour = 2;
}
// Node is network node
message Node {
// node ide
@@ -35,13 +53,13 @@ message Connect {
// Close is sent when the node disconnects from the network
message Close {
// network mode
// network node
Node node = 1;
}
// Neighbour is used to nnounce node neighbourhood
message Neighbour {
// network mode
// network node
Node node = 1;
// neighbours
repeated Node neighbours = 3;