micro/network/proto/network.proto
Milos Gajdos d6be91e8af
Changed RPC methods. Changed Network interface.
* Nodes/Topology removed from public methods from Network interface
* Peers() returns max depth 3 topology
* handler.Topology rpc endpoint removed
* handler.Peers rpc endpoint accept "depth" param to return max depth peers
2019-09-13 03:03:56 +01:00

52 lines
1.1 KiB
Protocol Buffer

syntax = "proto3";
package go.micro.network;
import "github.com/micro/go-micro/router/proto/router.proto";
// Network service is usesd to gain visibility into networks
service Network {
rpc ListPeers(PeerRequest) returns (PeerResponse) {};
rpc ListRoutes(go.micro.router.Request) returns (go.micro.router.ListResponse) {};
}
// PeerRequest requests list of peers
message PeerRequest {
// node topology depth
uint32 depth = 1;
}
// PeerResponse is returned by ListPeers
message PeerResponse {
// return peer topology
Peer peers = 1;
}
// Node is network node
message Node {
// node id
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 {
// network node
Node node = 1;
}
// Peer is used to advertise node peers
message Peer {
// network node
Node node = 1;
// node peers
repeated Peer peers = 2;
}