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 {
|
2019-09-10 01:14:23 +01:00
|
|
|
rpc ListPeers(PeerRequest) returns (PeerResponse) {};
|
2019-09-09 18:47:10 +01:00
|
|
|
rpc ListRoutes(go.micro.router.Request) returns (go.micro.router.ListResponse) {};
|
2019-08-30 12:29:26 +01:00
|
|
|
}
|
|
|
|
|
2019-09-10 13:31:02 +01:00
|
|
|
// PeerRequest requests list of peers
|
2019-09-10 01:14:23 +01:00
|
|
|
message PeerRequest {
|
2019-09-11 23:03:27 +01:00
|
|
|
// node topology depth
|
|
|
|
uint32 depth = 1;
|
2019-09-02 11:42:45 +01:00
|
|
|
}
|
|
|
|
|
2019-09-10 13:31:02 +01:00
|
|
|
// PeerResponse is returned by ListPeers
|
2019-09-10 01:14:23 +01:00
|
|
|
message PeerResponse {
|
2019-09-11 23:03:27 +01:00
|
|
|
// return peer topology
|
|
|
|
Peer peers = 1;
|
2019-09-02 11:42:45 +01:00
|
|
|
}
|
|
|
|
|
2019-08-28 20:11:19 +01:00
|
|
|
// Node is network node
|
|
|
|
message Node {
|
2019-09-10 13:31:02 +01:00
|
|
|
// node id
|
2019-08-28 20:11:19 +01:00
|
|
|
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-10 13:31:02 +01:00
|
|
|
// Peer is used to advertise node peers
|
2019-09-10 01:14:23 +01:00
|
|
|
message Peer {
|
2019-09-02 11:42:45 +01:00
|
|
|
// network node
|
2019-08-28 20:11:19 +01:00
|
|
|
Node node = 1;
|
2019-09-10 13:31:02 +01:00
|
|
|
// node peers
|
2019-09-10 01:14:23 +01:00
|
|
|
repeated Peer peers = 2;
|
2019-08-28 20:11:19 +01:00
|
|
|
}
|