From 9ad5ae6644b3b4c1ed597e1231609fcb4535d953 Mon Sep 17 00:00:00 2001 From: Milos Gajdos Date: Wed, 24 Jul 2019 21:07:04 +0100 Subject: [PATCH] Adds new RPC methods to router service interface We have added Advertise() and Process() RPCs in this commit. --- network/router/proto/router.micro.go | 99 +++++++++++++++++++ network/router/proto/router.pb.go | 141 ++++++++++++++++++++------- network/router/proto/router.proto | 9 ++ 3 files changed, 213 insertions(+), 36 deletions(-) diff --git a/network/router/proto/router.micro.go b/network/router/proto/router.micro.go index 23b8087c..ea705d5f 100644 --- a/network/router/proto/router.micro.go +++ b/network/router/proto/router.micro.go @@ -37,6 +37,8 @@ type RouterService interface { Watch(ctx context.Context, in *WatchRequest, opts ...client.CallOption) (Router_WatchService, error) Lookup(ctx context.Context, in *LookupRequest, opts ...client.CallOption) (*LookupResponse, error) List(ctx context.Context, in *ListRequest, opts ...client.CallOption) (*ListResponse, error) + Advertise(ctx context.Context, in *AdvertiseRequest, opts ...client.CallOption) (Router_AdvertiseService, error) + Process(ctx context.Context, in *Advert, opts ...client.CallOption) (*ProcessResponse, error) } type routerService struct { @@ -121,12 +123,68 @@ func (c *routerService) List(ctx context.Context, in *ListRequest, opts ...clien return out, nil } +func (c *routerService) Advertise(ctx context.Context, in *AdvertiseRequest, opts ...client.CallOption) (Router_AdvertiseService, error) { + req := c.c.NewRequest(c.name, "Router.Advertise", &AdvertiseRequest{}) + stream, err := c.c.Stream(ctx, req, opts...) + if err != nil { + return nil, err + } + if err := stream.Send(in); err != nil { + return nil, err + } + return &routerServiceAdvertise{stream}, nil +} + +type Router_AdvertiseService interface { + SendMsg(interface{}) error + RecvMsg(interface{}) error + Close() error + Recv() (*Advert, error) +} + +type routerServiceAdvertise struct { + stream client.Stream +} + +func (x *routerServiceAdvertise) Close() error { + return x.stream.Close() +} + +func (x *routerServiceAdvertise) SendMsg(m interface{}) error { + return x.stream.Send(m) +} + +func (x *routerServiceAdvertise) RecvMsg(m interface{}) error { + return x.stream.Recv(m) +} + +func (x *routerServiceAdvertise) Recv() (*Advert, error) { + m := new(Advert) + err := x.stream.Recv(m) + if err != nil { + return nil, err + } + return m, nil +} + +func (c *routerService) Process(ctx context.Context, in *Advert, opts ...client.CallOption) (*ProcessResponse, error) { + req := c.c.NewRequest(c.name, "Router.Process", in) + out := new(ProcessResponse) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // Server API for Router service type RouterHandler interface { Watch(context.Context, *WatchRequest, Router_WatchStream) error Lookup(context.Context, *LookupRequest, *LookupResponse) error List(context.Context, *ListRequest, *ListResponse) error + Advertise(context.Context, *AdvertiseRequest, Router_AdvertiseStream) error + Process(context.Context, *Advert, *ProcessResponse) error } func RegisterRouterHandler(s server.Server, hdlr RouterHandler, opts ...server.HandlerOption) error { @@ -134,6 +192,8 @@ func RegisterRouterHandler(s server.Server, hdlr RouterHandler, opts ...server.H Watch(ctx context.Context, stream server.Stream) error Lookup(ctx context.Context, in *LookupRequest, out *LookupResponse) error List(ctx context.Context, in *ListRequest, out *ListResponse) error + Advertise(ctx context.Context, stream server.Stream) error + Process(ctx context.Context, in *Advert, out *ProcessResponse) error } type Router struct { router @@ -188,3 +248,42 @@ func (h *routerHandler) Lookup(ctx context.Context, in *LookupRequest, out *Look func (h *routerHandler) List(ctx context.Context, in *ListRequest, out *ListResponse) error { return h.RouterHandler.List(ctx, in, out) } + +func (h *routerHandler) Advertise(ctx context.Context, stream server.Stream) error { + m := new(AdvertiseRequest) + if err := stream.Recv(m); err != nil { + return err + } + return h.RouterHandler.Advertise(ctx, m, &routerAdvertiseStream{stream}) +} + +type Router_AdvertiseStream interface { + SendMsg(interface{}) error + RecvMsg(interface{}) error + Close() error + Send(*Advert) error +} + +type routerAdvertiseStream struct { + stream server.Stream +} + +func (x *routerAdvertiseStream) Close() error { + return x.stream.Close() +} + +func (x *routerAdvertiseStream) SendMsg(m interface{}) error { + return x.stream.Send(m) +} + +func (x *routerAdvertiseStream) RecvMsg(m interface{}) error { + return x.stream.Recv(m) +} + +func (x *routerAdvertiseStream) Send(m *Advert) error { + return x.stream.Send(m) +} + +func (h *routerHandler) Process(ctx context.Context, in *Advert, out *ProcessResponse) error { + return h.RouterHandler.Process(ctx, in, out) +} diff --git a/network/router/proto/router.pb.go b/network/router/proto/router.pb.go index bad0d1ec..1584f983 100644 --- a/network/router/proto/router.pb.go +++ b/network/router/proto/router.pb.go @@ -187,6 +187,38 @@ func (m *WatchRequest) XXX_DiscardUnknown() { var xxx_messageInfo_WatchRequest proto.InternalMessageInfo +// AdvertiseRequest request a stream of Adverts +type AdvertiseRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AdvertiseRequest) Reset() { *m = AdvertiseRequest{} } +func (m *AdvertiseRequest) String() string { return proto.CompactTextString(m) } +func (*AdvertiseRequest) ProtoMessage() {} +func (*AdvertiseRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_367072455c71aedc, []int{3} +} + +func (m *AdvertiseRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AdvertiseRequest.Unmarshal(m, b) +} +func (m *AdvertiseRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AdvertiseRequest.Marshal(b, m, deterministic) +} +func (m *AdvertiseRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AdvertiseRequest.Merge(m, src) +} +func (m *AdvertiseRequest) XXX_Size() int { + return xxx_messageInfo_AdvertiseRequest.Size(m) +} +func (m *AdvertiseRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AdvertiseRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_AdvertiseRequest proto.InternalMessageInfo + // Advert is router advertsement streamed by Watch type Advert struct { // id of the advertising router @@ -208,7 +240,7 @@ func (m *Advert) Reset() { *m = Advert{} } func (m *Advert) String() string { return proto.CompactTextString(m) } func (*Advert) ProtoMessage() {} func (*Advert) Descriptor() ([]byte, []int) { - return fileDescriptor_367072455c71aedc, []int{3} + return fileDescriptor_367072455c71aedc, []int{4} } func (m *Advert) XXX_Unmarshal(b []byte) error { @@ -264,6 +296,38 @@ func (m *Advert) GetEvents() []*Event { return nil } +// ProcessResponse is returned by Process +type ProcessResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ProcessResponse) Reset() { *m = ProcessResponse{} } +func (m *ProcessResponse) String() string { return proto.CompactTextString(m) } +func (*ProcessResponse) ProtoMessage() {} +func (*ProcessResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_367072455c71aedc, []int{5} +} + +func (m *ProcessResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ProcessResponse.Unmarshal(m, b) +} +func (m *ProcessResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ProcessResponse.Marshal(b, m, deterministic) +} +func (m *ProcessResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProcessResponse.Merge(m, src) +} +func (m *ProcessResponse) XXX_Size() int { + return xxx_messageInfo_ProcessResponse.Size(m) +} +func (m *ProcessResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ProcessResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ProcessResponse proto.InternalMessageInfo + // Event is routing table event type Event struct { // type of event @@ -281,7 +345,7 @@ func (m *Event) Reset() { *m = Event{} } func (m *Event) String() string { return proto.CompactTextString(m) } func (*Event) ProtoMessage() {} func (*Event) Descriptor() ([]byte, []int) { - return fileDescriptor_367072455c71aedc, []int{4} + return fileDescriptor_367072455c71aedc, []int{6} } func (m *Event) XXX_Unmarshal(b []byte) error { @@ -334,7 +398,7 @@ func (m *ListRequest) Reset() { *m = ListRequest{} } func (m *ListRequest) String() string { return proto.CompactTextString(m) } func (*ListRequest) ProtoMessage() {} func (*ListRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_367072455c71aedc, []int{5} + return fileDescriptor_367072455c71aedc, []int{7} } func (m *ListRequest) XXX_Unmarshal(b []byte) error { @@ -367,7 +431,7 @@ func (m *ListResponse) Reset() { *m = ListResponse{} } func (m *ListResponse) String() string { return proto.CompactTextString(m) } func (*ListResponse) ProtoMessage() {} func (*ListResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_367072455c71aedc, []int{6} + return fileDescriptor_367072455c71aedc, []int{8} } func (m *ListResponse) XXX_Unmarshal(b []byte) error { @@ -408,7 +472,7 @@ func (m *Query) Reset() { *m = Query{} } func (m *Query) String() string { return proto.CompactTextString(m) } func (*Query) ProtoMessage() {} func (*Query) Descriptor() ([]byte, []int) { - return fileDescriptor_367072455c71aedc, []int{7} + return fileDescriptor_367072455c71aedc, []int{9} } func (m *Query) XXX_Unmarshal(b []byte) error { @@ -459,7 +523,7 @@ func (m *Route) Reset() { *m = Route{} } func (m *Route) String() string { return proto.CompactTextString(m) } func (*Route) ProtoMessage() {} func (*Route) Descriptor() ([]byte, []int) { - return fileDescriptor_367072455c71aedc, []int{8} + return fileDescriptor_367072455c71aedc, []int{10} } func (m *Route) XXX_Unmarshal(b []byte) error { @@ -528,7 +592,9 @@ func init() { proto.RegisterType((*LookupRequest)(nil), "LookupRequest") proto.RegisterType((*LookupResponse)(nil), "LookupResponse") proto.RegisterType((*WatchRequest)(nil), "WatchRequest") + proto.RegisterType((*AdvertiseRequest)(nil), "AdvertiseRequest") proto.RegisterType((*Advert)(nil), "Advert") + proto.RegisterType((*ProcessResponse)(nil), "ProcessResponse") proto.RegisterType((*Event)(nil), "Event") proto.RegisterType((*ListRequest)(nil), "ListRequest") proto.RegisterType((*ListResponse)(nil), "ListResponse") @@ -539,34 +605,37 @@ func init() { func init() { proto.RegisterFile("router.proto", fileDescriptor_367072455c71aedc) } var fileDescriptor_367072455c71aedc = []byte{ - // 461 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff,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e1, 0x3b, 0x4d, 0x2e, 0xe1, 0xb9, 0xf8, 0x3d, 0xed, 0xc9, - 0x15, 0xb9, 0x78, 0x68, 0xf0, 0xb7, 0x3f, 0x04, 0x84, 0x2c, 0x81, 0x46, 0x09, 0x01, 0x1f, 0x1c, - 0xce, 0xb3, 0xcb, 0xc3, 0x5b, 0x0e, 0xe6, 0x4b, 0xef, 0x46, 0xe0, 0x2b, 0x08, 0xfb, 0x33, 0xc6, - 0x24, 0x7b, 0x74, 0xfe, 0xcb, 0xff, 0xb3, 0xc7, 0xf7, 0x2d, 0x3d, 0x7c, 0x09, 0x53, 0xe7, 0x18, - 0xc6, 0xd9, 0x85, 0x8f, 0xcb, 0x79, 0x76, 0x69, 0xa3, 0xf4, 0xbe, 0x86, 0xfc, 0x43, 0xbd, 0xfd, - 0x1d, 0x00, 0x00, 0xff, 0xff, 0x5e, 0x52, 0x2f, 0xa0, 0x60, 0x03, 0x00, 0x00, + // 508 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x51, 0x6e, 0xd3, 0x40, + 0x10, 0xf5, 0x26, 0xb1, 0x2b, 0x4f, 0x13, 0xd7, 0x9d, 0x0f, 0x64, 0x45, 0x55, 0x09, 0x2b, 0x81, + 0xa2, 0x56, 0x2c, 0x55, 0x38, 0x41, 0x05, 0xfc, 0xf5, 0x03, 0x56, 0x20, 0xbe, 0x8d, 0x3d, 0x02, + 0x2b, 0x89, 0xed, 0xee, 0x6e, 0x52, 0xe5, 0x08, 0x9c, 0x81, 0x73, 0x71, 0x1f, 0xb4, 0xeb, 0x75, + 0x93, 0x46, 0xaa, 0xc4, 0xdf, 0xbc, 0x37, 0x33, 0xeb, 0xe7, 0x37, 0x33, 0x30, 0x56, 0xcd, 0xc6, + 0x90, 0x12, 0xad, 0x6a, 0x4c, 0xc3, 0xdf, 0xc2, 0xe4, 0xae, 0x69, 0x96, 0x9b,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0x74, 0x22, 0x0e, 0xc7, 0xc8, 0x03, 0xbc, 0x86, + 0xf8, 0x71, 0xff, 0xf1, 0x5c, 0x1c, 0xdf, 0xc2, 0xf4, 0xc4, 0x53, 0x4e, 0xc0, 0x1b, 0x38, 0xf1, + 0xcb, 0x88, 0x3d, 0x3f, 0x4d, 0xc5, 0xf1, 0x7e, 0x06, 0x3f, 0x22, 0x77, 0xcc, 0xef, 0xff, 0x05, + 0x00, 0x00, 0xff, 0xff, 0x05, 0x67, 0xe4, 0x0e, 0xdc, 0x03, 0x00, 0x00, } diff --git a/network/router/proto/router.proto b/network/router/proto/router.proto index 55eacf71..cf775908 100644 --- a/network/router/proto/router.proto +++ b/network/router/proto/router.proto @@ -5,6 +5,8 @@ service Router { rpc Watch(WatchRequest) returns (stream Event) {}; rpc Lookup(LookupRequest) returns (LookupResponse) {}; rpc List(ListRequest) returns (ListResponse) {}; + rpc Advertise(AdvertiseRequest) returns (stream Advert) {}; + rpc Process(Advert) returns (ProcessResponse) {}; } // LookupRequest is made to Lookup @@ -20,6 +22,10 @@ message LookupResponse { // WatchRequest is made to Watch Router message WatchRequest {} + +// AdvertiseRequest request a stream of Adverts +message AdvertiseRequest {} + // AdvertType defines the type of advert enum AdvertType { AdvertAnnounce = 0; @@ -40,6 +46,9 @@ message Advert { repeated Event events = 5; } +// ProcessResponse is returned by Process +message ProcessResponse {} + // EventType defines the type of event enum EventType { Create = 0;