From 98c63545a3404165da0b11b06b4ecbe1173b11bc Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Mon, 22 Mar 2021 08:32:52 +0300 Subject: [PATCH] cleanup Signed-off-by: Vasiliy Tolstov --- client/grpc/proto/test.pb.micro.go | 190 ----------------------------- 1 file changed, 190 deletions(-) delete mode 100644 client/grpc/proto/test.pb.micro.go diff --git a/client/grpc/proto/test.pb.micro.go b/client/grpc/proto/test.pb.micro.go deleted file mode 100644 index 395a8d5..0000000 --- a/client/grpc/proto/test.pb.micro.go +++ /dev/null @@ -1,190 +0,0 @@ -// Code generated by protoc-gen-micro. DO NOT EDIT. -// source: test.proto - -package helloworld - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -import ( - context "context" - api "github.com/unistack-org/micro/v3/api" - client "github.com/unistack-org/micro/v3/client" - server "github.com/unistack-org/micro/v3/server" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// Reference imports to suppress errors if they are not otherwise used. -var _ api.Endpoint -var _ context.Context -var _ client.Option -var _ server.Option - -// Api Endpoints for Test service - -func NewTestEndpoints() []*api.Endpoint { - return []*api.Endpoint{} -} - -// Client API for Test service - -type TestService interface { - Call(ctx context.Context, req *Request, opts ...client.CallOption) (*Response, error) - Stream(ctx context.Context, opts ...client.CallOption) (Test_StreamService, error) -} - -type testService struct { - c client.Client - name string -} - -func NewTestService(name string, c client.Client) TestService { - return &testService{ - c: c, - name: name, - } -} - -func (c *testService) Call(ctx context.Context, req *Request, opts ...client.CallOption) (*Response, error) { - rsp := &Response{} - err := c.c.Call(ctx, c.c.NewRequest(c.name, "Test.Call", req), rsp, opts...) - if err != nil { - return nil, err - } - return rsp, nil -} - -func (c *testService) Stream(ctx context.Context, opts ...client.CallOption) (Test_StreamService, error) { - stream, err := c.c.Stream(ctx, c.c.NewRequest(c.name, "Test.Stream", &Request{}), opts...) - if err != nil { - return nil, err - } - return &testServiceStream{stream}, nil -} - -type Test_StreamService interface { - Context() context.Context - SendMsg(interface{}) error - RecvMsg(interface{}) error - Close() error - Send(*Request) error - Recv() (*Response, error) -} - -type testServiceStream struct { - stream client.Stream -} - -func (x *testServiceStream) Close() error { - return x.stream.Close() -} - -func (x *testServiceStream) Context() context.Context { - return x.stream.Context() -} - -func (x *testServiceStream) SendMsg(m interface{}) error { - return x.stream.Send(m) -} - -func (x *testServiceStream) RecvMsg(m interface{}) error { - return x.stream.Recv(m) -} - -func (x *testServiceStream) Send(m *Request) error { - return x.stream.Send(m) -} - -func (x *testServiceStream) Recv() (*Response, error) { - m := &Response{} - err := x.stream.Recv(m) - if err != nil { - return nil, err - } - return m, nil -} - -// Server API for Test service - -type TestHandler interface { - Call(context.Context, *Request, *Response) error - Stream(context.Context, Test_StreamStream) error -} - -func RegisterTestHandler(s server.Server, hdlr TestHandler, opts ...server.HandlerOption) error { - type test interface { - Call(ctx context.Context, req *Request, rsp *Response) error - Stream(ctx context.Context, stream server.Stream) error - } - type Test struct { - test - } - h := &testHandler{hdlr} - return s.Handle(s.NewHandler(&Test{h}, opts...)) -} - -type testHandler struct { - TestHandler -} - -func (h *testHandler) Call(ctx context.Context, req *Request, rsp *Response) error { - return h.TestHandler.Call(ctx, req, rsp) -} - -func (h *testHandler) Stream(ctx context.Context, stream server.Stream) error { - return h.TestHandler.Stream(ctx, &testStreamStream{stream}) -} - -type Test_StreamStream interface { - Context() context.Context - SendMsg(interface{}) error - RecvMsg(interface{}) error - Close() error - Send(*Response) error - Recv() (*Request, error) -} - -type testStreamStream struct { - stream server.Stream -} - -func (x *testStreamStream) Close() error { - return x.stream.Close() -} - -func (x *testStreamStream) Context() context.Context { - return x.stream.Context() -} - -func (x *testStreamStream) SendMsg(m interface{}) error { - return x.stream.Send(m) -} - -func (x *testStreamStream) RecvMsg(m interface{}) error { - return x.stream.Recv(m) -} - -func (x *testStreamStream) Send(m *Response) error { - return x.stream.Send(m) -} - -func (x *testStreamStream) Recv() (*Request, error) { - m := &Request{} - if err := x.stream.Recv(m); err != nil { - return nil, err - } - return m, nil -}