micro/network/proto/network.proto

69 lines
1.4 KiB
Protocol Buffer
Raw Normal View History

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 Graph(GraphRequest) returns (GraphResponse) {};
rpc Nodes(NodesRequest) returns (NodesResponse) {};
rpc Routes(RoutesRequest) returns (RoutesResponse) {};
}
// PeerRequest requests list of peers
message NodesRequest {
// node topology depth
uint32 depth = 1;
}
// PeerResponse is returned by ListPeers
message NodesResponse {
// return peer topology
repeated Node nodes = 1;
}
message GraphRequest {
// node topology depth
uint32 depth = 1;
}
message GraphResponse {
Peer root = 1;
}
message RoutesRequest {
}
message RoutesResponse {
repeated go.micro.router.Route routes = 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;
}