2019-08-28 20:11:19 +01:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package go.micro.network;
|
|
|
|
|
2019-08-30 12:29:26 +01:00
|
|
|
import "github.com/micro/go-micro/router/proto/router.proto";
|
|
|
|
|
|
|
|
// Network service is usesd to gain visibility into networks
|
|
|
|
service Network {
|
|
|
|
rpc ListRoutes(go.micro.router.Request) returns (go.micro.router.ListResponse) {};
|
|
|
|
rpc ListNodes(ListRequest) returns (ListResponse) {};
|
2019-09-02 11:42:45 +01:00
|
|
|
rpc Neighbourhood(NeighbourhoodRequest) returns (NeighbourhoodResponse) {};
|
2019-08-30 12:29:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Empty request
|
|
|
|
message ListRequest {}
|
|
|
|
|
|
|
|
// ListResponse is returned by ListNodes and ListNeighbours
|
|
|
|
message ListResponse {
|
|
|
|
repeated Node nodes = 1;
|
|
|
|
}
|
|
|
|
|
2019-09-02 11:42:45 +01:00
|
|
|
// NeighbourhoodRequest is sent to query node neighbourhood
|
|
|
|
message NeighbourhoodRequest {
|
|
|
|
string id = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// NeighbourhoodResponse contains node neighbourhood hierarchy
|
|
|
|
message NeighbourhoodResponse {
|
2019-09-03 16:39:27 +01:00
|
|
|
Neighbour neighbourhood = 1;
|
2019-09-02 11:42:45 +01:00
|
|
|
}
|
|
|
|
|
2019-08-28 20:11:19 +01:00
|
|
|
// Node is network node
|
|
|
|
message Node {
|
|
|
|
// node ide
|
|
|
|
string id = 1;
|
|
|
|
// node address
|
|
|
|
string address = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Connect is sent when the node connects to the network
|
|
|
|
message Connect {
|
|
|
|
// network mode
|
|
|
|
Node node = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Close is sent when the node disconnects from the network
|
|
|
|
message Close {
|
2019-09-02 11:42:45 +01:00
|
|
|
// network node
|
2019-08-28 20:11:19 +01:00
|
|
|
Node node = 1;
|
|
|
|
}
|
|
|
|
|
2019-09-05 16:04:44 +01:00
|
|
|
// Solicit is sent when requesting route advertisement from the network nodes
|
|
|
|
message Solicit {
|
|
|
|
// network node
|
|
|
|
Node node = 1;
|
|
|
|
}
|
|
|
|
|
2019-08-28 20:11:19 +01:00
|
|
|
// Neighbour is used to nnounce node neighbourhood
|
|
|
|
message Neighbour {
|
2019-09-02 11:42:45 +01:00
|
|
|
// network node
|
2019-08-28 20:11:19 +01:00
|
|
|
Node node = 1;
|
|
|
|
// neighbours
|
|
|
|
repeated Node neighbours = 3;
|
|
|
|
}
|