From b9491f0a2427a2ae42689bb2af6e4688d8bcb1d5 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Sat, 8 May 2021 12:45:08 +0300 Subject: [PATCH] update for latest protoc-gen-micro Signed-off-by: Vasiliy Tolstov --- client/grpc/gproto/test_micro_http.pb.go | 130 +++++++++++++++ client/grpc/gproto/test_micro_rpc.pb.go | 5 +- codec/proto/test_micro_http.pb.go | 5 +- codec/segmentio/proto/test_micro_http.pb.go | 5 +- go.mod | 2 +- go.sum | 4 +- server/grpc/gproto/test_micro_rpc.pb.go | 5 +- server/http/generate.go | 4 +- server/http/proto/test.pb.go | 171 ++++++++++---------- server/http/proto/test.proto | 11 +- server/http/proto/test_micro_http.pb.go | 17 ++ 11 files changed, 258 insertions(+), 101 deletions(-) create mode 100644 client/grpc/gproto/test_micro_http.pb.go diff --git a/client/grpc/gproto/test_micro_http.pb.go b/client/grpc/gproto/test_micro_http.pb.go new file mode 100644 index 0000000..aea0270 --- /dev/null +++ b/client/grpc/gproto/test_micro_http.pb.go @@ -0,0 +1,130 @@ +// Code generated by protoc-gen-micro +// source: test.proto +package helloworld + +import ( + context "context" + _ "github.com/unistack-org/micro-client-http/v3" + proto "github.com/unistack-org/micro-tests/client/grpc/proto" + api "github.com/unistack-org/micro/v3/api" + client "github.com/unistack-org/micro/v3/client" + server "github.com/unistack-org/micro/v3/server" +) + +type testClient struct { + c client.Client + name string +} + +func NewTestClient(name string, c client.Client) TestClient { + return &testClient{c: c, name: name} +} + +func (c *testClient) Call(ctx context.Context, req *proto.Request, opts ...client.CallOption) (*proto.Response, error) { + rsp := &proto.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 *testClient) Stream(ctx context.Context, opts ...client.CallOption) (Test_StreamClient, error) { + stream, err := c.c.Stream(ctx, c.c.NewRequest(c.name, "Test.Stream", &proto.Request{}), opts...) + if err != nil { + return nil, err + } + return &testClientStream{stream}, nil +} + +type testClientStream struct { + stream client.Stream +} + +func (s *testClientStream) Close() error { + return s.stream.Close() +} + +func (s *testClientStream) Context() context.Context { + return s.stream.Context() +} + +func (s *testClientStream) SendMsg(msg interface{}) error { + return s.stream.Send(msg) +} + +func (s *testClientStream) RecvMsg(msg interface{}) error { + return s.stream.Recv(msg) +} + +func (s *testClientStream) Send(msg *proto.Request) error { + return s.stream.Send(msg) +} + +func (s *testClientStream) Recv() (*proto.Response, error) { + msg := &proto.Response{} + if err := s.stream.Recv(msg); err != nil { + return nil, err + } + return msg, nil +} + +type testServer struct { + TestServer +} + +func (h *testServer) Call(ctx context.Context, req *proto.Request, rsp *proto.Response) error { + return h.TestServer.Call(ctx, req, rsp) +} + +func (h *testServer) Stream(ctx context.Context, stream server.Stream) error { + return h.TestServer.Stream(ctx, &testStreamStream{stream}) +} + +type testStreamStream struct { + stream server.Stream +} + +func (s *testStreamStream) Close() error { + return s.stream.Close() +} + +func (s *testStreamStream) Context() context.Context { + return s.stream.Context() +} + +func (s *testStreamStream) SendMsg(msg interface{}) error { + return s.stream.Send(msg) +} + +func (s *testStreamStream) RecvMsg(msg interface{}) error { + return s.stream.Recv(msg) +} + +func (s *testStreamStream) Send(msg *proto.Response) error { + return s.stream.Send(msg) +} + +func (s *testStreamStream) Recv() (*proto.Request, error) { + msg := &proto.Request{} + if err := s.stream.Recv(msg); err != nil { + return nil, err + } + return msg, nil +} + +func RegisterTestServer(s server.Server, sh TestServer, opts ...server.HandlerOption) error { + type test interface { + Call(ctx context.Context, req *proto.Request, rsp *proto.Response) error + Stream(ctx context.Context, stream server.Stream) error + } + type Test struct { + test + } + h := &testServer{sh} + var nopts []server.HandlerOption + for _, endpoint := range NewTestEndpoints() { + nopts = append(nopts, api.WithEndpoint(endpoint)) + } + return s.Handle(s.NewHandler(&Test{h}, append(nopts, opts...)...)) +} diff --git a/client/grpc/gproto/test_micro_rpc.pb.go b/client/grpc/gproto/test_micro_rpc.pb.go index 7a2c837..24a6e51 100644 --- a/client/grpc/gproto/test_micro_rpc.pb.go +++ b/client/grpc/gproto/test_micro_rpc.pb.go @@ -121,8 +121,9 @@ func RegisterTestServer(s server.Server, sh TestServer, opts ...server.HandlerOp test } h := &testServer{sh} + var nopts []server.HandlerOption for _, endpoint := range NewTestEndpoints() { - opts = append(opts, api.WithEndpoint(endpoint)) + nopts = append(nopts, api.WithEndpoint(endpoint)) } - return s.Handle(s.NewHandler(&Test{h}, opts...)) + return s.Handle(s.NewHandler(&Test{h}, append(nopts, opts...)...)) } diff --git a/codec/proto/test_micro_http.pb.go b/codec/proto/test_micro_http.pb.go index 4520dfa..9170003 100644 --- a/codec/proto/test_micro_http.pb.go +++ b/codec/proto/test_micro_http.pb.go @@ -45,8 +45,9 @@ func RegisterTestServer(s server.Server, sh TestServer, opts ...server.HandlerOp test } h := &testServer{sh} + var nopts []server.HandlerOption for _, endpoint := range NewTestEndpoints() { - opts = append(opts, api.WithEndpoint(endpoint)) + nopts = append(nopts, api.WithEndpoint(endpoint)) } - return s.Handle(s.NewHandler(&Test{h}, opts...)) + return s.Handle(s.NewHandler(&Test{h}, append(nopts, opts...)...)) } diff --git a/codec/segmentio/proto/test_micro_http.pb.go b/codec/segmentio/proto/test_micro_http.pb.go index 9598cb8..cc2c360 100644 --- a/codec/segmentio/proto/test_micro_http.pb.go +++ b/codec/segmentio/proto/test_micro_http.pb.go @@ -44,8 +44,9 @@ func RegisterTestServer(s server.Server, sh TestServer, opts ...server.HandlerOp test } h := &testServer{sh} + var nopts []server.HandlerOption for _, endpoint := range NewTestEndpoints() { - opts = append(opts, api.WithEndpoint(endpoint)) + nopts = append(nopts, api.WithEndpoint(endpoint)) } - return s.Handle(s.NewHandler(&Test{h}, opts...)) + return s.Handle(s.NewHandler(&Test{h}, append(nopts, opts...)...)) } diff --git a/go.mod b/go.mod index e6a342a..2b69aea 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( github.com/unistack-org/micro-config-vault/v3 v3.2.9 github.com/unistack-org/micro-meter-victoriametrics/v3 v3.3.1 github.com/unistack-org/micro-metrics-prometheus/v3 v3.1.1 - github.com/unistack-org/micro-proto v0.0.2-0.20210227213711-77c7563bd01e + github.com/unistack-org/micro-proto v0.0.2 github.com/unistack-org/micro-router-register/v3 v3.2.2 github.com/unistack-org/micro-server-grpc/v3 v3.3.6 github.com/unistack-org/micro-server-http/v3 v3.3.17 diff --git a/go.sum b/go.sum index 2acb303..f39ea83 100644 --- a/go.sum +++ b/go.sum @@ -479,8 +479,8 @@ github.com/unistack-org/micro-meter-victoriametrics/v3 v3.3.1 h1:zsGJSjQrkz60xvq github.com/unistack-org/micro-meter-victoriametrics/v3 v3.3.1/go.mod h1:7FsTyXS62RNA+RDiNscRMjHhVc7iHbpTHbdVYKFktLA= github.com/unistack-org/micro-metrics-prometheus/v3 v3.1.1 h1:AZVQ8l1p1pIUyImQo/if/5t1g9C9du9ulMRqATSmgGo= github.com/unistack-org/micro-metrics-prometheus/v3 v3.1.1/go.mod h1:QfquVeYZ2+BqBQ5bv1+uFAeWFiacvwanRDy3nGVqo3c= -github.com/unistack-org/micro-proto v0.0.2-0.20210227213711-77c7563bd01e h1:hQJ3V0QggeFdU5967wO5v6oWnaK42wUnG4UU4zWcyu4= -github.com/unistack-org/micro-proto v0.0.2-0.20210227213711-77c7563bd01e/go.mod h1:GYO53DWmeldRIo90cAdQx8bLr/WJMxW62W4ja74p1Ac= +github.com/unistack-org/micro-proto v0.0.2 h1:mL1ZPRGPCWJOiMBiJrkk8Y513rPrJmhJWxyLceckAXU= +github.com/unistack-org/micro-proto v0.0.2/go.mod h1:GYO53DWmeldRIo90cAdQx8bLr/WJMxW62W4ja74p1Ac= github.com/unistack-org/micro-router-register/v3 v3.2.2 h1:lYCymDHkJfhZWYQ4+Sb7Fu+NlqoysQCnpJytHGhdnws= github.com/unistack-org/micro-router-register/v3 v3.2.2/go.mod h1:Y9Qtlg4NHqq5rR6X6Jm+04LoSJMi7/OOCm2mRueZYTE= github.com/unistack-org/micro-server-grpc/v3 v3.3.6 h1:z4Koe7K4tVVs4XAo6C34XAvg+HH4/yW6pf/RFyTjkq0= diff --git a/server/grpc/gproto/test_micro_rpc.pb.go b/server/grpc/gproto/test_micro_rpc.pb.go index f461068..f6f180d 100644 --- a/server/grpc/gproto/test_micro_rpc.pb.go +++ b/server/grpc/gproto/test_micro_rpc.pb.go @@ -44,8 +44,9 @@ func RegisterTestServer(s server.Server, sh TestServer, opts ...server.HandlerOp test } h := &testServer{sh} + var nopts []server.HandlerOption for _, endpoint := range NewTestEndpoints() { - opts = append(opts, api.WithEndpoint(endpoint)) + nopts = append(nopts, api.WithEndpoint(endpoint)) } - return s.Handle(s.NewHandler(&Test{h}, opts...)) + return s.Handle(s.NewHandler(&Test{h}, append(nopts, opts...)...)) } diff --git a/server/http/generate.go b/server/http/generate.go index b28effd..d22d650 100644 --- a/server/http/generate.go +++ b/server/http/generate.go @@ -1,5 +1,5 @@ package http -//go:generate protoc -I./proto -I. -I/home/vtolstov/.cache/go-path/pkg/mod/github.com/unistack-org/micro-proto@v0.0.1 --go_out=paths=source_relative:./proto --micro_out=components=micro|http,debug=true,paths=source_relative:./proto proto/test.proto +//go:generate protoc -I./proto -I. -I/home/vtolstov/devel/projects/unistack/micro/micro-proto --go_out=paths=source_relative:./proto proto/test.proto -///go:generate protoc -I./proto -I. -I/home/vtolstov/devel/projects/unistack/micro/micro-proto --go_out=paths=source_relative:./proto --micro_out=components=micro|http,debug=true,paths=source_relative:./proto proto/test.proto +//go:generate protoc -I./proto -I. -I/home/vtolstov/devel/projects/unistack/micro/micro-proto --micro_out=components=micro|http,debug=true,tag_path=./proto,paths=source_relative:./proto proto/test.proto diff --git a/server/http/proto/test.pb.go b/server/http/proto/test.pb.go index a336787..205a9b5 100644 --- a/server/http/proto/test.pb.go +++ b/server/http/proto/test.pb.go @@ -9,6 +9,7 @@ package pb import ( _ "github.com/unistack-org/micro-proto/api" _ "github.com/unistack-org/micro-proto/openapiv2" + _ "github.com/unistack-org/micro-proto/tag" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" @@ -28,7 +29,7 @@ type CallReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty" xml:",attr"` Req string `protobuf:"bytes,2,opt,name=req,proto3" json:"req,omitempty"` Arg1 string `protobuf:"bytes,3,opt,name=arg1,proto3" json:"arg1,omitempty"` Arg2 uint64 `protobuf:"varint,4,opt,name=arg2,proto3" json:"arg2,omitempty"` @@ -373,92 +374,96 @@ var File_test_proto protoreflect.FileDescriptor var file_test_proto_rawDesc = []byte{ 0x0a, 0x0a, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x74, 0x65, - 0x73, 0x74, 0x1a, 0x15, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x6f, 0x70, 0x65, 0x6e, 0x61, - 0x70, 0x69, 0x76, 0x32, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb9, 0x01, 0x0a, 0x07, 0x43, 0x61, 0x6c, 0x6c, 0x52, - 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x71, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x31, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x67, 0x31, 0x12, 0x12, 0x0a, 0x04, - 0x61, 0x72, 0x67, 0x32, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x61, 0x72, 0x67, 0x32, - 0x12, 0x24, 0x0a, 0x06, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0c, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x06, - 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x5f, 0x69, 0x64, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x49, 0x64, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x69, - 0x64, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x03, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x49, - 0x64, 0x73, 0x22, 0x68, 0x0a, 0x06, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x12, 0x1f, 0x0a, 0x0b, - 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x61, 0x72, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x0a, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x41, 0x72, 0x67, 0x73, 0x12, 0x3d, 0x0a, - 0x0b, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x61, 0x72, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x52, 0x0a, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x41, 0x72, 0x67, 0x73, 0x22, 0x1b, 0x0a, 0x07, - 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x73, 0x70, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x73, 0x70, 0x22, 0x30, 0x0a, 0x08, 0x43, 0x61, 0x6c, - 0x6c, 0x52, 0x65, 0x71, 0x31, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x71, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, 0x71, 0x22, 0x1c, 0x0a, 0x08, 0x43, - 0x61, 0x6c, 0x6c, 0x52, 0x73, 0x70, 0x31, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x73, 0x70, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x73, 0x70, 0x22, 0x19, 0x0a, 0x05, 0x45, 0x72, 0x72, - 0x6f, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6d, 0x73, 0x67, 0x32, 0x97, 0x01, 0x0a, 0x0a, 0x54, 0x65, 0x73, 0x74, 0x44, 0x6f, 0x75, - 0x62, 0x6c, 0x65, 0x12, 0x88, 0x01, 0x0a, 0x0a, 0x43, 0x61, 0x6c, 0x6c, 0x44, 0x6f, 0x75, 0x62, - 0x6c, 0x65, 0x12, 0x0d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, - 0x71, 0x1a, 0x0d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x73, 0x70, - 0x22, 0x5c, 0x92, 0x41, 0x34, 0x2a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x4a, 0x2c, 0x0a, 0x07, 0x64, - 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x21, 0x0a, 0x0e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x20, - 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0f, 0x0a, 0x0d, 0x1a, 0x0b, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x22, - 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x2f, - 0x63, 0x61, 0x6c, 0x6c, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x3a, 0x01, 0x2a, 0x32, 0xf2, - 0x04, 0x0a, 0x04, 0x54, 0x65, 0x73, 0x74, 0x12, 0xae, 0x01, 0x0a, 0x12, 0x43, 0x61, 0x6c, 0x6c, - 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x0d, - 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x0d, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x73, 0x70, 0x22, 0x7a, 0x92, 0x41, - 0x42, 0x2a, 0x12, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4a, 0x2c, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, - 0x12, 0x21, 0x0a, 0x0e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x0f, 0x0a, 0x0d, 0x1a, 0x0b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x45, 0x72, - 0x72, 0x6f, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x22, 0x2a, 0x2f, 0x76, 0x31, 0x2f, 0x74, - 0x65, 0x73, 0x74, 0x2f, 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, - 0x64, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x7b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x5f, 0x69, 0x64, 0x73, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0xaa, 0x01, 0x0a, 0x11, 0x43, 0x61, 0x6c, - 0x6c, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x0d, - 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x0d, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x73, 0x70, 0x22, 0x77, 0x92, 0x41, - 0x41, 0x2a, 0x11, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x49, - 0x6e, 0x74, 0x36, 0x34, 0x4a, 0x2c, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, - 0x21, 0x0a, 0x0e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x0f, 0x0a, 0x0d, 0x1a, 0x0b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x45, 0x72, 0x72, - 0x6f, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x22, 0x28, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, - 0x73, 0x74, 0x2f, 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, - 0x5f, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x2f, 0x7b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x69, 0x64, - 0x73, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x7c, 0x0a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x0d, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x0d, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x73, 0x70, 0x22, 0x56, 0x92, 0x41, 0x34, - 0x2a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x4a, 0x2c, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x73, 0x74, 0x1a, 0x0d, 0x74, 0x61, 0x67, 0x2f, 0x74, 0x61, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x15, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, + 0x69, 0x76, 0x32, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcb, 0x01, 0x0a, 0x07, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, + 0x71, 0x12, 0x24, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x10, 0x9a, 0x84, 0x9e, 0x03, 0x0b, 0x78, 0x6d, 0x6c, 0x3a, 0x22, 0x2c, 0x61, 0x74, 0x74, 0x72, + 0x22, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x71, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, + 0x31, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x67, 0x31, 0x12, 0x12, 0x0a, + 0x04, 0x61, 0x72, 0x67, 0x32, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x61, 0x72, 0x67, + 0x32, 0x12, 0x24, 0x0a, 0x06, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0c, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, + 0x06, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x49, 0x64, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, + 0x69, 0x64, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x03, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x36, 0x34, + 0x49, 0x64, 0x73, 0x22, 0x68, 0x0a, 0x06, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x12, 0x1f, 0x0a, + 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x61, 0x72, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x0a, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x41, 0x72, 0x67, 0x73, 0x12, 0x3d, + 0x0a, 0x0b, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x61, 0x72, 0x67, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x52, 0x0a, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x41, 0x72, 0x67, 0x73, 0x22, 0x1b, 0x0a, + 0x07, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x73, 0x70, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x73, 0x70, 0x22, 0x30, 0x0a, 0x08, 0x43, 0x61, + 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x31, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, + 0x71, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, 0x71, 0x22, 0x1c, 0x0a, 0x08, + 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x73, 0x70, 0x31, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x73, 0x70, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x73, 0x70, 0x22, 0x19, 0x0a, 0x05, 0x45, 0x72, + 0x72, 0x6f, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6d, 0x73, 0x67, 0x32, 0x9f, 0x01, 0x0a, 0x0a, 0x54, 0x65, 0x73, 0x74, 0x44, 0x6f, + 0x75, 0x62, 0x6c, 0x65, 0x12, 0x90, 0x01, 0x0a, 0x0a, 0x43, 0x61, 0x6c, 0x6c, 0x44, 0x6f, 0x75, + 0x62, 0x6c, 0x65, 0x12, 0x0d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, + 0x65, 0x71, 0x1a, 0x0d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x73, + 0x70, 0x22, 0x64, 0x92, 0x41, 0x34, 0x2a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x4a, 0x2c, 0x0a, 0x07, + 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x21, 0x0a, 0x0e, 0x45, 0x72, 0x72, 0x6f, 0x72, + 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0f, 0x0a, 0x0d, 0x1a, 0x0b, 0x2e, + 0x74, 0x65, 0x73, 0x74, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, + 0x22, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, + 0x2f, 0x63, 0x61, 0x6c, 0x6c, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x3a, 0x01, 0x2a, 0xba, + 0xea, 0xff, 0xf9, 0x01, 0x02, 0x08, 0x05, 0x32, 0x8c, 0x05, 0x0a, 0x04, 0x54, 0x65, 0x73, 0x74, + 0x12, 0xb7, 0x01, 0x0a, 0x12, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x0d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, + 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x0d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x61, + 0x6c, 0x6c, 0x52, 0x73, 0x70, 0x22, 0x82, 0x01, 0x92, 0x41, 0x42, 0x2a, 0x12, 0x43, 0x61, 0x6c, + 0x6c, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4a, + 0x2c, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x21, 0x0a, 0x0e, 0x45, 0x72, + 0x72, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0f, 0x0a, 0x0d, + 0x1a, 0x0b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x2f, 0x22, 0x2a, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x63, 0x61, + 0x6c, 0x6c, 0x5f, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x2f, 0x7b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x73, 0x7d, 0x3a, + 0x01, 0x2a, 0xba, 0xea, 0xff, 0xf9, 0x01, 0x02, 0x08, 0x05, 0x12, 0xb2, 0x01, 0x0a, 0x11, 0x43, + 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x49, 0x6e, 0x74, 0x36, 0x34, + 0x12, 0x0d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x1a, + 0x0d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x73, 0x70, 0x22, 0x7f, + 0x92, 0x41, 0x41, 0x2a, 0x11, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x4a, 0x2c, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x21, 0x0a, 0x0e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0f, 0x0a, 0x0d, 0x1a, 0x0b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x45, - 0x72, 0x72, 0x6f, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x22, 0x14, 0x2f, 0x76, 0x31, 0x2f, - 0x74, 0x65, 0x73, 0x74, 0x2f, 0x63, 0x61, 0x6c, 0x6c, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, - 0x3a, 0x01, 0x2a, 0x12, 0x8d, 0x01, 0x0a, 0x09, 0x43, 0x61, 0x6c, 0x6c, 0x45, 0x72, 0x72, 0x6f, - 0x72, 0x12, 0x0e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, - 0x31, 0x1a, 0x0e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x73, 0x70, - 0x31, 0x22, 0x60, 0x92, 0x41, 0x39, 0x2a, 0x09, 0x43, 0x61, 0x6c, 0x6c, 0x45, 0x72, 0x72, 0x6f, - 0x72, 0x4a, 0x2c, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x21, 0x0a, 0x0e, + 0x72, 0x72, 0x6f, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x22, 0x28, 0x2f, 0x76, 0x31, 0x2f, + 0x74, 0x65, 0x73, 0x74, 0x2f, 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x2f, 0x7b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, + 0x69, 0x64, 0x73, 0x7d, 0x3a, 0x01, 0x2a, 0xba, 0xea, 0xff, 0xf9, 0x01, 0x02, 0x08, 0x05, 0x12, + 0x84, 0x01, 0x0a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x0d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, + 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x0d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, + 0x61, 0x6c, 0x6c, 0x52, 0x73, 0x70, 0x22, 0x5e, 0x92, 0x41, 0x34, 0x2a, 0x04, 0x43, 0x61, 0x6c, + 0x6c, 0x4a, 0x2c, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x21, 0x0a, 0x0e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0f, 0x0a, 0x0d, 0x1a, 0x0b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x22, 0x19, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, - 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, - 0x3a, 0x01, 0x2a, 0x42, 0x3a, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x75, 0x6e, 0x69, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2d, 0x6f, 0x72, 0x67, 0x2f, 0x6d, - 0x69, 0x63, 0x72, 0x6f, 0x2d, 0x74, 0x65, 0x73, 0x74, 0x73, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b, 0x70, 0x62, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x22, 0x14, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, + 0x63, 0x61, 0x6c, 0x6c, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x3a, 0x01, 0x2a, 0xba, 0xea, + 0xff, 0xf9, 0x01, 0x02, 0x08, 0x05, 0x12, 0x8d, 0x01, 0x0a, 0x09, 0x43, 0x61, 0x6c, 0x6c, 0x45, + 0x72, 0x72, 0x6f, 0x72, 0x12, 0x0e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x61, 0x6c, 0x6c, + 0x52, 0x65, 0x71, 0x31, 0x1a, 0x0e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x61, 0x6c, 0x6c, + 0x52, 0x73, 0x70, 0x31, 0x22, 0x60, 0x92, 0x41, 0x39, 0x2a, 0x09, 0x43, 0x61, 0x6c, 0x6c, 0x45, + 0x72, 0x72, 0x6f, 0x72, 0x4a, 0x2c, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, + 0x21, 0x0a, 0x0e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x0f, 0x0a, 0x0d, 0x1a, 0x0b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x45, 0x72, 0x72, + 0x6f, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x22, 0x19, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, + 0x73, 0x74, 0x2f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2f, 0x7b, 0x6e, 0x61, + 0x6d, 0x65, 0x7d, 0x3a, 0x01, 0x2a, 0x42, 0x3a, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x6e, 0x69, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2d, 0x6f, 0x72, + 0x67, 0x2f, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2d, 0x74, 0x65, 0x73, 0x74, 0x73, 0x2f, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b, + 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/server/http/proto/test.proto b/server/http/proto/test.proto index 93a7473..9de827e 100644 --- a/server/http/proto/test.proto +++ b/server/http/proto/test.proto @@ -4,6 +4,7 @@ package test; option go_package = "github.com/unistack-org/micro-tests/server/http/proto;pb"; +import "tag/tag.proto"; import "api/annotations.proto"; import "openapiv2/annotations.proto"; import "google/protobuf/wrappers.proto"; @@ -26,7 +27,7 @@ service TestDouble { } }; option (micro.api.http) = { post: "/v1/testdouble/call/{name}"; body: "*"; }; - //option (micro.api.micro_method) = { timeout: 5; }; + option (micro.api.micro_method) = { timeout: 5; }; }; }; @@ -47,7 +48,7 @@ service Test { } }; option (micro.api.http) = { post: "/v1/test/call_repeated_string/{string_ids}"; body: "*"; }; - //option (micro.api.micro_method) = { timeout: 5; }; + option (micro.api.micro_method) = { timeout: 5; }; }; rpc CallRepeatedInt64(CallReq) returns (CallRsp) { option (micro.openapiv2.openapiv2_operation) = { @@ -65,7 +66,7 @@ service Test { } }; option (micro.api.http) = { post: "/v1/test/call_repeated_int64/{int64_ids}"; body: "*"; }; - //option (micro.api.micro_method) = { timeout: 5; }; + option (micro.api.micro_method) = { timeout: 5; }; }; @@ -86,7 +87,7 @@ service Test { } }; option (micro.api.http) = { post: "/v1/test/call/{name}"; body: "*"; }; - //option (micro.api.micro_method) = { timeout: 5; }; + option (micro.api.micro_method) = { timeout: 5; }; }; rpc CallError(CallReq1) returns (CallRsp1) { option (micro.openapiv2.openapiv2_operation) = { @@ -109,7 +110,7 @@ service Test { }; message CallReq { - string name = 1; + string name = 1 [(micro.tag.tags) = "xml:\",attr\"" ]; string req = 2; string arg1 = 3; uint64 arg2 = 4; diff --git a/server/http/proto/test_micro_http.pb.go b/server/http/proto/test_micro_http.pb.go index 23f0fb1..4610a5f 100644 --- a/server/http/proto/test_micro_http.pb.go +++ b/server/http/proto/test_micro_http.pb.go @@ -9,6 +9,7 @@ import ( client "github.com/unistack-org/micro/v3/client" server "github.com/unistack-org/micro/v3/server" http "net/http" + time "time" ) type testDoubleClient struct { @@ -31,6 +32,7 @@ func (c *testDoubleClient) CallDouble(ctx context.Context, req *CallReq, opts .. v3.Path("/v1/testdouble/call/{name}"), v3.Body("*"), ) + opts = append(opts, client.WithRequestTimeout(time.Second*5)) rsp := &CallRsp{} err := c.c.Call(ctx, c.c.NewRequest(c.name, "TestDouble.CallDouble", req), rsp, opts...) if err != nil { @@ -44,6 +46,9 @@ type testDoubleServer struct { } func (h *testDoubleServer) CallDouble(ctx context.Context, req *CallReq, rsp *CallRsp) error { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, time.Second*5) + defer cancel() return h.TestDoubleServer.CallDouble(ctx, req, rsp) } @@ -82,6 +87,7 @@ func (c *testClient) CallRepeatedString(ctx context.Context, req *CallReq, opts v3.Path("/v1/test/call_repeated_string/{string_ids}"), v3.Body("*"), ) + opts = append(opts, client.WithRequestTimeout(time.Second*5)) rsp := &CallRsp{} err := c.c.Call(ctx, c.c.NewRequest(c.name, "Test.CallRepeatedString", req), rsp, opts...) if err != nil { @@ -101,6 +107,7 @@ func (c *testClient) CallRepeatedInt64(ctx context.Context, req *CallReq, opts . v3.Path("/v1/test/call_repeated_int64/{int64_ids}"), v3.Body("*"), ) + opts = append(opts, client.WithRequestTimeout(time.Second*5)) rsp := &CallRsp{} err := c.c.Call(ctx, c.c.NewRequest(c.name, "Test.CallRepeatedInt64", req), rsp, opts...) if err != nil { @@ -120,6 +127,7 @@ func (c *testClient) Call(ctx context.Context, req *CallReq, opts ...client.Call v3.Path("/v1/test/call/{name}"), v3.Body("*"), ) + opts = append(opts, client.WithRequestTimeout(time.Second*5)) rsp := &CallRsp{} err := c.c.Call(ctx, c.c.NewRequest(c.name, "Test.Call", req), rsp, opts...) if err != nil { @@ -152,14 +160,23 @@ type testServer struct { } func (h *testServer) CallRepeatedString(ctx context.Context, req *CallReq, rsp *CallRsp) error { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, time.Second*5) + defer cancel() return h.TestServer.CallRepeatedString(ctx, req, rsp) } func (h *testServer) CallRepeatedInt64(ctx context.Context, req *CallReq, rsp *CallRsp) error { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, time.Second*5) + defer cancel() return h.TestServer.CallRepeatedInt64(ctx, req, rsp) } func (h *testServer) Call(ctx context.Context, req *CallReq, rsp *CallRsp) error { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, time.Second*5) + defer cancel() return h.TestServer.Call(ctx, req, rsp) }