Neighbour is now peer. Neighbourhood is Peers. Small refactor.
This commit is contained in:
@@ -36,7 +36,7 @@ var _ server.Option
|
||||
|
||||
type NetworkService interface {
|
||||
ListNodes(ctx context.Context, in *ListRequest, opts ...client.CallOption) (*ListResponse, error)
|
||||
Neighbourhood(ctx context.Context, in *NeighbourhoodRequest, opts ...client.CallOption) (*NeighbourhoodResponse, error)
|
||||
ListPeers(ctx context.Context, in *PeerRequest, opts ...client.CallOption) (*PeerResponse, error)
|
||||
ListRoutes(ctx context.Context, in *proto1.Request, opts ...client.CallOption) (*proto1.ListResponse, error)
|
||||
}
|
||||
|
||||
@@ -68,9 +68,9 @@ func (c *networkService) ListNodes(ctx context.Context, in *ListRequest, opts ..
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *networkService) Neighbourhood(ctx context.Context, in *NeighbourhoodRequest, opts ...client.CallOption) (*NeighbourhoodResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Network.Neighbourhood", in)
|
||||
out := new(NeighbourhoodResponse)
|
||||
func (c *networkService) ListPeers(ctx context.Context, in *PeerRequest, opts ...client.CallOption) (*PeerResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Network.ListPeers", in)
|
||||
out := new(PeerResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -92,14 +92,14 @@ func (c *networkService) ListRoutes(ctx context.Context, in *proto1.Request, opt
|
||||
|
||||
type NetworkHandler interface {
|
||||
ListNodes(context.Context, *ListRequest, *ListResponse) error
|
||||
Neighbourhood(context.Context, *NeighbourhoodRequest, *NeighbourhoodResponse) error
|
||||
ListPeers(context.Context, *PeerRequest, *PeerResponse) error
|
||||
ListRoutes(context.Context, *proto1.Request, *proto1.ListResponse) error
|
||||
}
|
||||
|
||||
func RegisterNetworkHandler(s server.Server, hdlr NetworkHandler, opts ...server.HandlerOption) error {
|
||||
type network interface {
|
||||
ListNodes(ctx context.Context, in *ListRequest, out *ListResponse) error
|
||||
Neighbourhood(ctx context.Context, in *NeighbourhoodRequest, out *NeighbourhoodResponse) error
|
||||
ListPeers(ctx context.Context, in *PeerRequest, out *PeerResponse) error
|
||||
ListRoutes(ctx context.Context, in *proto1.Request, out *proto1.ListResponse) error
|
||||
}
|
||||
type Network struct {
|
||||
@@ -117,8 +117,8 @@ func (h *networkHandler) ListNodes(ctx context.Context, in *ListRequest, out *Li
|
||||
return h.NetworkHandler.ListNodes(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *networkHandler) Neighbourhood(ctx context.Context, in *NeighbourhoodRequest, out *NeighbourhoodResponse) error {
|
||||
return h.NetworkHandler.Neighbourhood(ctx, in, out)
|
||||
func (h *networkHandler) ListPeers(ctx context.Context, in *PeerRequest, out *PeerResponse) error {
|
||||
return h.NetworkHandler.ListPeers(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *networkHandler) ListRoutes(ctx context.Context, in *proto1.Request, out *proto1.ListResponse) error {
|
||||
|
@@ -93,129 +93,129 @@ func (m *ListResponse) GetNodes() []*Node {
|
||||
return nil
|
||||
}
|
||||
|
||||
// NeighbourhoodRequest is sent to query node neighbourhood
|
||||
type NeighbourhoodRequest struct {
|
||||
// PeerRequest is sent to query node peers
|
||||
type PeerRequest struct {
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *NeighbourhoodRequest) Reset() { *m = NeighbourhoodRequest{} }
|
||||
func (m *NeighbourhoodRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*NeighbourhoodRequest) ProtoMessage() {}
|
||||
func (*NeighbourhoodRequest) Descriptor() ([]byte, []int) {
|
||||
func (m *PeerRequest) Reset() { *m = PeerRequest{} }
|
||||
func (m *PeerRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*PeerRequest) ProtoMessage() {}
|
||||
func (*PeerRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_8571034d60397816, []int{2}
|
||||
}
|
||||
|
||||
func (m *NeighbourhoodRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_NeighbourhoodRequest.Unmarshal(m, b)
|
||||
func (m *PeerRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PeerRequest.Unmarshal(m, b)
|
||||
}
|
||||
func (m *NeighbourhoodRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_NeighbourhoodRequest.Marshal(b, m, deterministic)
|
||||
func (m *PeerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_PeerRequest.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *NeighbourhoodRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_NeighbourhoodRequest.Merge(m, src)
|
||||
func (m *PeerRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_PeerRequest.Merge(m, src)
|
||||
}
|
||||
func (m *NeighbourhoodRequest) XXX_Size() int {
|
||||
return xxx_messageInfo_NeighbourhoodRequest.Size(m)
|
||||
func (m *PeerRequest) XXX_Size() int {
|
||||
return xxx_messageInfo_PeerRequest.Size(m)
|
||||
}
|
||||
func (m *NeighbourhoodRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_NeighbourhoodRequest.DiscardUnknown(m)
|
||||
func (m *PeerRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_PeerRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_NeighbourhoodRequest proto.InternalMessageInfo
|
||||
var xxx_messageInfo_PeerRequest proto.InternalMessageInfo
|
||||
|
||||
func (m *NeighbourhoodRequest) GetId() string {
|
||||
func (m *PeerRequest) GetId() string {
|
||||
if m != nil {
|
||||
return m.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// NeighbourhoodResponse returns node neighbourhood
|
||||
type NeighbourhoodResponse struct {
|
||||
Neighbourhoodi *Neighbourhood `protobuf:"bytes,1,opt,name=neighbourhoodi,proto3" json:"neighbourhoodi,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *NeighbourhoodResponse) Reset() { *m = NeighbourhoodResponse{} }
|
||||
func (m *NeighbourhoodResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*NeighbourhoodResponse) ProtoMessage() {}
|
||||
func (*NeighbourhoodResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_8571034d60397816, []int{3}
|
||||
}
|
||||
|
||||
func (m *NeighbourhoodResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_NeighbourhoodResponse.Unmarshal(m, b)
|
||||
}
|
||||
func (m *NeighbourhoodResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_NeighbourhoodResponse.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *NeighbourhoodResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_NeighbourhoodResponse.Merge(m, src)
|
||||
}
|
||||
func (m *NeighbourhoodResponse) XXX_Size() int {
|
||||
return xxx_messageInfo_NeighbourhoodResponse.Size(m)
|
||||
}
|
||||
func (m *NeighbourhoodResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_NeighbourhoodResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_NeighbourhoodResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *NeighbourhoodResponse) GetNeighbourhoodi() *Neighbourhood {
|
||||
if m != nil {
|
||||
return m.Neighbourhoodi
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Neighbourhood struct {
|
||||
Node *Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
|
||||
Neighbours []*Node `protobuf:"bytes,2,rep,name=neighbours,proto3" json:"neighbours,omitempty"`
|
||||
// PeerResponse returns node neighbourhood
|
||||
type PeerResponse struct {
|
||||
Peers *Peers `protobuf:"bytes,1,opt,name=peers,proto3" json:"peers,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Neighbourhood) Reset() { *m = Neighbourhood{} }
|
||||
func (m *Neighbourhood) String() string { return proto.CompactTextString(m) }
|
||||
func (*Neighbourhood) ProtoMessage() {}
|
||||
func (*Neighbourhood) Descriptor() ([]byte, []int) {
|
||||
func (m *PeerResponse) Reset() { *m = PeerResponse{} }
|
||||
func (m *PeerResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*PeerResponse) ProtoMessage() {}
|
||||
func (*PeerResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_8571034d60397816, []int{3}
|
||||
}
|
||||
|
||||
func (m *PeerResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PeerResponse.Unmarshal(m, b)
|
||||
}
|
||||
func (m *PeerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_PeerResponse.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *PeerResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_PeerResponse.Merge(m, src)
|
||||
}
|
||||
func (m *PeerResponse) XXX_Size() int {
|
||||
return xxx_messageInfo_PeerResponse.Size(m)
|
||||
}
|
||||
func (m *PeerResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_PeerResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_PeerResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *PeerResponse) GetPeers() *Peers {
|
||||
if m != nil {
|
||||
return m.Peers
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Peers struct {
|
||||
Node *Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
|
||||
Peers []*Node `protobuf:"bytes,2,rep,name=peers,proto3" json:"peers,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Peers) Reset() { *m = Peers{} }
|
||||
func (m *Peers) String() string { return proto.CompactTextString(m) }
|
||||
func (*Peers) ProtoMessage() {}
|
||||
func (*Peers) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_8571034d60397816, []int{4}
|
||||
}
|
||||
|
||||
func (m *Neighbourhood) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Neighbourhood.Unmarshal(m, b)
|
||||
func (m *Peers) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Peers.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Neighbourhood) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Neighbourhood.Marshal(b, m, deterministic)
|
||||
func (m *Peers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Peers.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Neighbourhood) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Neighbourhood.Merge(m, src)
|
||||
func (m *Peers) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Peers.Merge(m, src)
|
||||
}
|
||||
func (m *Neighbourhood) XXX_Size() int {
|
||||
return xxx_messageInfo_Neighbourhood.Size(m)
|
||||
func (m *Peers) XXX_Size() int {
|
||||
return xxx_messageInfo_Peers.Size(m)
|
||||
}
|
||||
func (m *Neighbourhood) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Neighbourhood.DiscardUnknown(m)
|
||||
func (m *Peers) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Peers.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Neighbourhood proto.InternalMessageInfo
|
||||
var xxx_messageInfo_Peers proto.InternalMessageInfo
|
||||
|
||||
func (m *Neighbourhood) GetNode() *Node {
|
||||
func (m *Peers) GetNode() *Node {
|
||||
if m != nil {
|
||||
return m.Node
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Neighbourhood) GetNeighbours() []*Node {
|
||||
func (m *Peers) GetPeers() []*Node {
|
||||
if m != nil {
|
||||
return m.Neighbours
|
||||
return m.Peers
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -393,52 +393,52 @@ func (m *Solicit) GetNode() *Node {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Neighbour is used to nnounce node neighbourhood
|
||||
type Neighbour struct {
|
||||
// Peer is used to announce node peers
|
||||
type Peer struct {
|
||||
// network node
|
||||
Node *Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
|
||||
// neighbours
|
||||
Neighbours []*Neighbour `protobuf:"bytes,2,rep,name=neighbours,proto3" json:"neighbours,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
Peers []*Peer `protobuf:"bytes,2,rep,name=peers,proto3" json:"peers,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Neighbour) Reset() { *m = Neighbour{} }
|
||||
func (m *Neighbour) String() string { return proto.CompactTextString(m) }
|
||||
func (*Neighbour) ProtoMessage() {}
|
||||
func (*Neighbour) Descriptor() ([]byte, []int) {
|
||||
func (m *Peer) Reset() { *m = Peer{} }
|
||||
func (m *Peer) String() string { return proto.CompactTextString(m) }
|
||||
func (*Peer) ProtoMessage() {}
|
||||
func (*Peer) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_8571034d60397816, []int{9}
|
||||
}
|
||||
|
||||
func (m *Neighbour) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Neighbour.Unmarshal(m, b)
|
||||
func (m *Peer) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Peer.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Neighbour) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Neighbour.Marshal(b, m, deterministic)
|
||||
func (m *Peer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Peer.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Neighbour) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Neighbour.Merge(m, src)
|
||||
func (m *Peer) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Peer.Merge(m, src)
|
||||
}
|
||||
func (m *Neighbour) XXX_Size() int {
|
||||
return xxx_messageInfo_Neighbour.Size(m)
|
||||
func (m *Peer) XXX_Size() int {
|
||||
return xxx_messageInfo_Peer.Size(m)
|
||||
}
|
||||
func (m *Neighbour) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Neighbour.DiscardUnknown(m)
|
||||
func (m *Peer) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Peer.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Neighbour proto.InternalMessageInfo
|
||||
var xxx_messageInfo_Peer proto.InternalMessageInfo
|
||||
|
||||
func (m *Neighbour) GetNode() *Node {
|
||||
func (m *Peer) GetNode() *Node {
|
||||
if m != nil {
|
||||
return m.Node
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Neighbour) GetNeighbours() []*Neighbour {
|
||||
func (m *Peer) GetPeers() []*Peer {
|
||||
if m != nil {
|
||||
return m.Neighbours
|
||||
return m.Peers
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -446,42 +446,41 @@ func (m *Neighbour) GetNeighbours() []*Neighbour {
|
||||
func init() {
|
||||
proto.RegisterType((*ListRequest)(nil), "go.micro.network.ListRequest")
|
||||
proto.RegisterType((*ListResponse)(nil), "go.micro.network.ListResponse")
|
||||
proto.RegisterType((*NeighbourhoodRequest)(nil), "go.micro.network.NeighbourhoodRequest")
|
||||
proto.RegisterType((*NeighbourhoodResponse)(nil), "go.micro.network.NeighbourhoodResponse")
|
||||
proto.RegisterType((*Neighbourhood)(nil), "go.micro.network.Neighbourhood")
|
||||
proto.RegisterType((*PeerRequest)(nil), "go.micro.network.PeerRequest")
|
||||
proto.RegisterType((*PeerResponse)(nil), "go.micro.network.PeerResponse")
|
||||
proto.RegisterType((*Peers)(nil), "go.micro.network.Peers")
|
||||
proto.RegisterType((*Node)(nil), "go.micro.network.Node")
|
||||
proto.RegisterType((*Connect)(nil), "go.micro.network.Connect")
|
||||
proto.RegisterType((*Close)(nil), "go.micro.network.Close")
|
||||
proto.RegisterType((*Solicit)(nil), "go.micro.network.Solicit")
|
||||
proto.RegisterType((*Neighbour)(nil), "go.micro.network.Neighbour")
|
||||
proto.RegisterType((*Peer)(nil), "go.micro.network.Peer")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("network.proto", fileDescriptor_8571034d60397816) }
|
||||
|
||||
var fileDescriptor_8571034d60397816 = []byte{
|
||||
// 372 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0x5d, 0x4f, 0xea, 0x40,
|
||||
0x10, 0xbd, 0xf4, 0xc2, 0x6d, 0x18, 0x2e, 0xc4, 0x6c, 0xd4, 0x34, 0x18, 0x94, 0xec, 0x03, 0x12,
|
||||
0xa3, 0xc5, 0x40, 0xf0, 0x45, 0xdf, 0x78, 0xe0, 0x85, 0xf0, 0x80, 0x7f, 0x40, 0xdb, 0x6e, 0xca,
|
||||
0x46, 0xe8, 0xe0, 0xee, 0x36, 0xfe, 0x01, 0x7f, 0xb8, 0xd9, 0x76, 0xc1, 0x52, 0xbe, 0xd2, 0xb7,
|
||||
0xee, 0xcc, 0x99, 0x73, 0x66, 0xa6, 0x67, 0xa0, 0x1e, 0x31, 0xf5, 0x85, 0xe2, 0xc3, 0x5d, 0x09,
|
||||
0x54, 0x48, 0xce, 0x42, 0x74, 0x97, 0xdc, 0x17, 0xe8, 0x9a, 0x78, 0x73, 0x10, 0x72, 0x35, 0x8f,
|
||||
0x3d, 0xd7, 0xc7, 0x65, 0x2f, 0xc9, 0xf4, 0x42, 0x7c, 0x48, 0x3f, 0x04, 0xc6, 0x8a, 0x89, 0x5e,
|
||||
0x52, 0x69, 0x1e, 0x29, 0x0d, 0xad, 0x43, 0x6d, 0xc2, 0xa5, 0x9a, 0xb1, 0xcf, 0x98, 0x49, 0x45,
|
||||
0x5f, 0xe0, 0x7f, 0xfa, 0x94, 0x2b, 0x8c, 0x24, 0x23, 0xf7, 0x50, 0x89, 0x30, 0x60, 0xd2, 0x29,
|
||||
0xb5, 0xff, 0x76, 0x6b, 0xfd, 0x4b, 0x37, 0xaf, 0xea, 0x4e, 0x31, 0x60, 0xb3, 0x14, 0x44, 0x3b,
|
||||
0x70, 0x3e, 0x65, 0x3c, 0x9c, 0x7b, 0x18, 0x8b, 0x39, 0x62, 0x60, 0x58, 0x49, 0x03, 0x2c, 0x1e,
|
||||
0x38, 0xa5, 0x76, 0xa9, 0x5b, 0x9d, 0x59, 0x3c, 0xa0, 0x6f, 0x70, 0x91, 0xc3, 0x19, 0xb9, 0x31,
|
||||
0x34, 0xa2, 0x6c, 0x82, 0x27, 0x45, 0xb5, 0xfe, 0xcd, 0x1e, 0xdd, 0x2d, 0x82, 0x5c, 0x19, 0x95,
|
||||
0x50, 0xdf, 0x02, 0x90, 0x3b, 0x28, 0xeb, 0x1e, 0x0d, 0xdf, 0xa1, 0x39, 0x12, 0x0c, 0x79, 0x02,
|
||||
0xd8, 0xd0, 0x49, 0xc7, 0x3a, 0x3a, 0x79, 0x06, 0x49, 0x1f, 0xa1, 0xac, 0x63, 0xf9, 0x71, 0x89,
|
||||
0x03, 0xf6, 0x7b, 0x10, 0x08, 0x26, 0x35, 0x99, 0x0e, 0xae, 0x9f, 0x74, 0x08, 0xf6, 0x08, 0xa3,
|
||||
0x88, 0xf9, 0xaa, 0x48, 0x83, 0x74, 0x00, 0x95, 0xd1, 0x02, 0x25, 0x2b, 0x54, 0x34, 0x04, 0xfb,
|
||||
0x15, 0x17, 0xdc, 0xe7, 0xc5, 0xb4, 0x14, 0x54, 0x37, 0x9b, 0x2c, 0xb4, 0xc5, 0xe7, 0x3d, 0x5b,
|
||||
0xbc, 0x3a, 0xf2, 0x1f, 0xb3, 0xab, 0xec, 0x7f, 0x5b, 0x60, 0x4f, 0x53, 0x04, 0x99, 0x40, 0x55,
|
||||
0x7b, 0x52, 0x53, 0x4b, 0xd2, 0xda, 0x65, 0xc8, 0xf8, 0xb7, 0x79, 0x7d, 0x28, 0x9d, 0x1a, 0x8c,
|
||||
0xfe, 0x21, 0x5e, 0xde, 0x19, 0x9d, 0x53, 0xde, 0x32, 0xd4, 0xb7, 0x27, 0x71, 0x1b, 0x8d, 0x31,
|
||||
0x40, 0xa2, 0xaa, 0x0f, 0x4d, 0x12, 0xe7, 0xb7, 0xd0, 0x9c, 0xde, 0x9a, 0xb2, 0xb5, 0x93, 0xd9,
|
||||
0x6e, 0xd6, 0xfb, 0x97, 0x1c, 0xe9, 0xe0, 0x27, 0x00, 0x00, 0xff, 0xff, 0x63, 0xe7, 0xb4, 0xb0,
|
||||
0xfc, 0x03, 0x00, 0x00,
|
||||
// 353 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0x51, 0x4f, 0xc2, 0x30,
|
||||
0x10, 0xc7, 0x19, 0x32, 0x17, 0x6e, 0x60, 0x4c, 0x1f, 0x74, 0x21, 0x99, 0x21, 0x7d, 0x22, 0x46,
|
||||
0x86, 0x81, 0xf0, 0xa6, 0x4f, 0x3c, 0xf8, 0x42, 0x88, 0x99, 0x5f, 0x40, 0xd8, 0x2e, 0xd8, 0x08,
|
||||
0x3b, 0x6c, 0x4b, 0xfc, 0xd6, 0x7e, 0x06, 0xd3, 0x76, 0x44, 0x84, 0xcc, 0x84, 0xc4, 0xb7, 0xde,
|
||||
0xdd, 0xff, 0x7e, 0x77, 0x6d, 0xef, 0xa0, 0x5d, 0xa0, 0xfe, 0x24, 0xf9, 0x9e, 0x6c, 0x24, 0x69,
|
||||
0x62, 0x97, 0x4b, 0x4a, 0xd6, 0x22, 0x93, 0x94, 0x94, 0xfe, 0xce, 0x68, 0x29, 0xf4, 0xdb, 0x76,
|
||||
0x91, 0x64, 0xb4, 0x1e, 0xd8, 0xc8, 0x60, 0x49, 0x7d, 0x77, 0x90, 0xb4, 0xd5, 0x28, 0x07, 0x36,
|
||||
0xb3, 0x34, 0x1c, 0x86, 0xb7, 0x21, 0x9c, 0x0a, 0xa5, 0x53, 0xfc, 0xd8, 0xa2, 0xd2, 0xfc, 0x01,
|
||||
0x5a, 0xce, 0x54, 0x1b, 0x2a, 0x14, 0xb2, 0x3b, 0xf0, 0x0b, 0xca, 0x51, 0x45, 0x5e, 0xf7, 0xac,
|
||||
0x17, 0x0e, 0xaf, 0x92, 0xc3, 0xaa, 0xc9, 0x8c, 0x72, 0x4c, 0x9d, 0x88, 0xc7, 0x10, 0x3e, 0x23,
|
||||
0xca, 0x12, 0xc6, 0x2e, 0xa0, 0x2e, 0xf2, 0xc8, 0xeb, 0x7a, 0xbd, 0x66, 0x5a, 0x17, 0x39, 0x7f,
|
||||
0x84, 0x96, 0x0b, 0x97, 0xf0, 0x3e, 0xf8, 0x1b, 0x44, 0xa9, 0xac, 0x24, 0x1c, 0x5e, 0x1f, 0xc3,
|
||||
0x8d, 0x5c, 0xa5, 0x4e, 0xc5, 0xe7, 0xe0, 0x5b, 0x9b, 0xdd, 0x42, 0xc3, 0xd4, 0x2b, 0xd3, 0xaa,
|
||||
0x7a, 0xb2, 0x1a, 0x73, 0x01, 0x57, 0xa3, 0xfe, 0xf7, 0x05, 0x5c, 0x89, 0x7b, 0x68, 0x18, 0xf3,
|
||||
0xb0, 0x73, 0x16, 0x41, 0x30, 0xcf, 0x73, 0x89, 0xca, 0x70, 0x8c, 0x73, 0x67, 0xf2, 0x31, 0x04,
|
||||
0x13, 0x2a, 0x0a, 0xcc, 0xf4, 0x29, 0x6d, 0xf1, 0x11, 0xf8, 0x93, 0x15, 0x29, 0x3c, 0x29, 0x69,
|
||||
0x0c, 0xc1, 0x0b, 0xad, 0x44, 0x26, 0x4e, 0xab, 0xf5, 0x0a, 0x0d, 0xf3, 0x6e, 0xff, 0xfc, 0x6c,
|
||||
0xf6, 0x27, 0x9d, 0x68, 0xf8, 0xe5, 0x41, 0x30, 0x73, 0x7e, 0x36, 0x85, 0xa6, 0x99, 0x20, 0xc3,
|
||||
0x52, 0x2c, 0x3e, 0xce, 0xdb, 0x9b, 0xb6, 0xce, 0x4d, 0x55, 0xd8, 0x0d, 0x08, 0xaf, 0xed, 0x68,
|
||||
0xee, 0xdf, 0xe3, 0x8a, 0x2e, 0xaa, 0x69, 0xfb, 0xe3, 0xc6, 0x6b, 0xec, 0x09, 0xc0, 0xf2, 0xcd,
|
||||
0x02, 0x28, 0x16, 0xfd, 0xe8, 0xcb, 0x95, 0xd8, 0x91, 0xe2, 0xa3, 0xc8, 0xef, 0xb6, 0x16, 0xe7,
|
||||
0x76, 0x79, 0x46, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xaf, 0xb8, 0x9b, 0x3f, 0x94, 0x03, 0x00,
|
||||
0x00,
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@ import "github.com/micro/go-micro/router/proto/router.proto";
|
||||
// Network service is usesd to gain visibility into networks
|
||||
service Network {
|
||||
rpc ListNodes(ListRequest) returns (ListResponse) {};
|
||||
rpc Neighbourhood(NeighbourhoodRequest) returns (NeighbourhoodResponse) {};
|
||||
rpc ListPeers(PeerRequest) returns (PeerResponse) {};
|
||||
rpc ListRoutes(go.micro.router.Request) returns (go.micro.router.ListResponse) {};
|
||||
}
|
||||
|
||||
@@ -19,19 +19,19 @@ message ListResponse {
|
||||
repeated Node nodes = 1;
|
||||
}
|
||||
|
||||
// NeighbourhoodRequest is sent to query node neighbourhood
|
||||
message NeighbourhoodRequest {
|
||||
// PeerRequest is sent to query node peers
|
||||
message PeerRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
// NeighbourhoodResponse returns node neighbourhood
|
||||
message NeighbourhoodResponse {
|
||||
Neighbourhood neighbourhoodi = 1;
|
||||
// PeerResponse returns node neighbourhood
|
||||
message PeerResponse {
|
||||
Peers peers = 1;
|
||||
}
|
||||
|
||||
message Neighbourhood {
|
||||
message Peers {
|
||||
Node node = 1;
|
||||
repeated Node neighbours = 2;
|
||||
repeated Node peers = 2;
|
||||
}
|
||||
|
||||
// Node is network node
|
||||
@@ -60,10 +60,10 @@ message Solicit {
|
||||
Node node = 1;
|
||||
}
|
||||
|
||||
// Neighbour is used to nnounce node neighbourhood
|
||||
message Neighbour {
|
||||
// Peer is used to announce node peers
|
||||
message Peer {
|
||||
// network node
|
||||
Node node = 1;
|
||||
// neighbours
|
||||
repeated Neighbour neighbours = 2;
|
||||
repeated Peer peers = 2;
|
||||
}
|
||||
|
Reference in New Issue
Block a user