refactor and cleanup some router code
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
||||
// source: router.proto
|
||||
// source: micro/go-micro/router/service/proto/router.proto
|
||||
|
||||
package go_micro_router
|
||||
|
||||
@@ -38,7 +38,6 @@ type RouterService interface {
|
||||
Watch(ctx context.Context, in *WatchRequest, opts ...client.CallOption) (Router_WatchService, error)
|
||||
Advertise(ctx context.Context, in *Request, opts ...client.CallOption) (Router_AdvertiseService, error)
|
||||
Process(ctx context.Context, in *Advert, opts ...client.CallOption) (*ProcessResponse, error)
|
||||
Status(ctx context.Context, in *Request, opts ...client.CallOption) (*StatusResponse, error)
|
||||
}
|
||||
|
||||
type routerService struct {
|
||||
@@ -167,16 +166,6 @@ func (c *routerService) Process(ctx context.Context, in *Advert, opts ...client.
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *routerService) Status(ctx context.Context, in *Request, opts ...client.CallOption) (*StatusResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Router.Status", in)
|
||||
out := new(StatusResponse)
|
||||
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 {
|
||||
@@ -184,7 +173,6 @@ type RouterHandler interface {
|
||||
Watch(context.Context, *WatchRequest, Router_WatchStream) error
|
||||
Advertise(context.Context, *Request, Router_AdvertiseStream) error
|
||||
Process(context.Context, *Advert, *ProcessResponse) error
|
||||
Status(context.Context, *Request, *StatusResponse) error
|
||||
}
|
||||
|
||||
func RegisterRouterHandler(s server.Server, hdlr RouterHandler, opts ...server.HandlerOption) error {
|
||||
@@ -193,7 +181,6 @@ func RegisterRouterHandler(s server.Server, hdlr RouterHandler, opts ...server.H
|
||||
Watch(ctx context.Context, stream server.Stream) error
|
||||
Advertise(ctx context.Context, stream server.Stream) error
|
||||
Process(ctx context.Context, in *Advert, out *ProcessResponse) error
|
||||
Status(ctx context.Context, in *Request, out *StatusResponse) error
|
||||
}
|
||||
type Router struct {
|
||||
router
|
||||
@@ -284,10 +271,6 @@ func (h *routerHandler) Process(ctx context.Context, in *Advert, out *ProcessRes
|
||||
return h.RouterHandler.Process(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *routerHandler) Status(ctx context.Context, in *Request, out *StatusResponse) error {
|
||||
return h.RouterHandler.Status(ctx, in, out)
|
||||
}
|
||||
|
||||
// Client API for Table service
|
||||
|
||||
type TableService interface {
|
||||
|
Reference in New Issue
Block a user