@@ -1,4 +1,4 @@
|
||||
package grpc
|
||||
|
||||
//go:generate go get google.golang.org/grpc/cmd/protoc-gen-go-grpc
|
||||
//go:generate protoc -I./proto -I$GOPATH/pkg/mod/github.com/grpc-ecosystem/grpc-gateway@v1.9.5/third_party/googleapis -I. --go-grpc_out=paths=source_relative:./proto --go_out=paths=source_relative:./proto --go-micro_out=components=micro|rpc,debug=true,standalone=true,paths=source_relative:./gproto proto/test.proto
|
||||
//go:generate go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
|
||||
//go:generate sh -c "protoc -I./proto -I$(go list -f '{{ .Dir }}' -m go.unistack.org/micro-proto/v3) -I. --go-grpc_out=paths=source_relative:./proto --go_out=paths=source_relative:./proto --go-micro_out=components='micro|rpc',debug=true,standalone=true,paths=source_relative:./gproto proto/test.proto"
|
||||
|
@@ -1,20 +1,28 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// protoc-gen-go-micro version: v3.4.2
|
||||
// protoc-gen-go-micro version: v3.5.3
|
||||
// source: test.proto
|
||||
|
||||
package helloworld
|
||||
|
||||
import (
|
||||
context "context"
|
||||
proto "github.com/unistack-org/micro-tests/server/grpc/proto"
|
||||
api "github.com/unistack-org/micro/v3/api"
|
||||
client "github.com/unistack-org/micro/v3/client"
|
||||
proto "go.unistack.org/micro-tests/server/grpc/proto"
|
||||
api "go.unistack.org/micro/v3/api"
|
||||
client "go.unistack.org/micro/v3/client"
|
||||
)
|
||||
|
||||
var (
|
||||
TestName = "Test"
|
||||
|
||||
TestEndpoints = []api.Endpoint{}
|
||||
TestEndpoints = []api.Endpoint{
|
||||
{
|
||||
Name: "Test.Call",
|
||||
Path: []string{"/api/v0/test/call/TEST"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
func NewTestEndpoints() []api.Endpoint {
|
||||
|
@@ -1,15 +1,15 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// protoc-gen-go-micro version: v3.4.2
|
||||
// protoc-gen-go-micro version: v3.5.3
|
||||
// source: test.proto
|
||||
|
||||
package helloworld
|
||||
|
||||
import (
|
||||
context "context"
|
||||
proto "github.com/unistack-org/micro-tests/server/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"
|
||||
proto "go.unistack.org/micro-tests/server/grpc/proto"
|
||||
api "go.unistack.org/micro/v3/api"
|
||||
client "go.unistack.org/micro/v3/client"
|
||||
server "go.unistack.org/micro/v3/server"
|
||||
)
|
||||
|
||||
type testClient struct {
|
||||
|
@@ -6,21 +6,21 @@ import (
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
gclient "github.com/unistack-org/micro-client-grpc/v3"
|
||||
protocodec "github.com/unistack-org/micro-codec-proto/v3"
|
||||
regRouter "github.com/unistack-org/micro-router-register/v3"
|
||||
gserver "github.com/unistack-org/micro-server-grpc/v3"
|
||||
httpsrv "github.com/unistack-org/micro-server-http/v3"
|
||||
gpb "github.com/unistack-org/micro-tests/server/grpc/gproto"
|
||||
pb "github.com/unistack-org/micro-tests/server/grpc/proto"
|
||||
"github.com/unistack-org/micro/v3/broker"
|
||||
"github.com/unistack-org/micro/v3/client"
|
||||
"github.com/unistack-org/micro/v3/codec"
|
||||
"github.com/unistack-org/micro/v3/errors"
|
||||
"github.com/unistack-org/micro/v3/register"
|
||||
"github.com/unistack-org/micro/v3/router"
|
||||
"github.com/unistack-org/micro/v3/server"
|
||||
health "github.com/unistack-org/micro/v3/server/health"
|
||||
gclient "go.unistack.org/micro-client-grpc/v3"
|
||||
protocodec "go.unistack.org/micro-codec-proto/v3"
|
||||
regRouter "go.unistack.org/micro-router-register/v3"
|
||||
gserver "go.unistack.org/micro-server-grpc/v3"
|
||||
httpsrv "go.unistack.org/micro-server-http/v3"
|
||||
gpb "go.unistack.org/micro-tests/server/grpc/gproto"
|
||||
pb "go.unistack.org/micro-tests/server/grpc/proto"
|
||||
"go.unistack.org/micro/v3/broker"
|
||||
"go.unistack.org/micro/v3/client"
|
||||
"go.unistack.org/micro/v3/codec"
|
||||
"go.unistack.org/micro/v3/errors"
|
||||
"go.unistack.org/micro/v3/register"
|
||||
"go.unistack.org/micro/v3/router"
|
||||
"go.unistack.org/micro/v3/server"
|
||||
health "go.unistack.org/micro/v3/server/health"
|
||||
jsonpb "google.golang.org/protobuf/encoding/protojson"
|
||||
)
|
||||
|
||||
|
@@ -1,13 +1,13 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.17.3
|
||||
// source: test.proto
|
||||
|
||||
package helloworld
|
||||
|
||||
import (
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
_ "go.unistack.org/micro-proto/v3/api"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
@@ -190,32 +190,31 @@ 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, 0x0a, 0x68, 0x65,
|
||||
0x6c, 0x6c, 0x6f, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
|
||||
0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5d, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||
0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x62, 0x72, 0x6f,
|
||||
0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x68, 0x65, 0x6c, 0x6c,
|
||||
0x6f, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x2e, 0x42, 0x72, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x06, 0x62,
|
||||
0x72, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x1e, 0x0a, 0x06, 0x42, 0x72, 0x6f, 0x6b, 0x65, 0x6e, 0x12,
|
||||
0x14, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
|
||||
0x66, 0x69, 0x65, 0x6c, 0x64, 0x22, 0x48, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||
0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
|
||||
0x6d, 0x73, 0x67, 0x12, 0x2a, 0x0a, 0x06, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20,
|
||||
0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x6f, 0x72, 0x6c, 0x64,
|
||||
0x2e, 0x42, 0x72, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x06, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x6e, 0x32,
|
||||
0x5c, 0x0a, 0x04, 0x54, 0x65, 0x73, 0x74, 0x12, 0x54, 0x0a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x12,
|
||||
0x13, 0x2e, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x2e, 0x52, 0x65, 0x71,
|
||||
0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x6f, 0x72, 0x6c,
|
||||
0x64, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93,
|
||||
0x02, 0x1b, 0x22, 0x16, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x30, 0x2f, 0x74, 0x65, 0x73, 0x74,
|
||||
0x2f, 0x63, 0x61, 0x6c, 0x6c, 0x2f, 0x54, 0x45, 0x53, 0x54, 0x3a, 0x01, 0x2a, 0x42, 0x42, 0x5a,
|
||||
0x40, 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, 0x67, 0x72, 0x70, 0x63,
|
||||
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x6f, 0x72, 0x6c,
|
||||
0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x6c, 0x6c, 0x6f, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x1a, 0x15, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e,
|
||||
0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
|
||||
0x5d, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75,
|
||||
0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x12,
|
||||
0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,
|
||||
0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x12, 0x2e, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x2e,
|
||||
0x42, 0x72, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x06, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x1e,
|
||||
0x0a, 0x06, 0x42, 0x72, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c,
|
||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x22, 0x48,
|
||||
0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73,
|
||||
0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x2a, 0x0a, 0x06,
|
||||
0x62, 0x72, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x68,
|
||||
0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x2e, 0x42, 0x72, 0x6f, 0x6b, 0x65, 0x6e,
|
||||
0x52, 0x06, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0x5c, 0x0a, 0x04, 0x54, 0x65, 0x73, 0x74,
|
||||
0x12, 0x54, 0x0a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x13, 0x2e, 0x68, 0x65, 0x6c, 0x6c, 0x6f,
|
||||
0x77, 0x6f, 0x72, 0x6c, 0x64, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e,
|
||||
0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||
0x6e, 0x73, 0x65, 0x22, 0x21, 0xb2, 0xea, 0xff, 0xf9, 0x01, 0x1b, 0x22, 0x16, 0x2f, 0x61, 0x70,
|
||||
0x69, 0x2f, 0x76, 0x30, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x63, 0x61, 0x6c, 0x6c, 0x2f, 0x54,
|
||||
0x45, 0x53, 0x54, 0x3a, 0x01, 0x2a, 0x42, 0x3a, 0x5a, 0x38, 0x67, 0x6f, 0x2e, 0x75, 0x6e, 0x69,
|
||||
0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2d,
|
||||
0x74, 0x65, 0x73, 0x74, 0x73, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70,
|
||||
0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x6f, 0x72,
|
||||
0x6c, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
@@ -2,12 +2,12 @@ syntax = "proto3";
|
||||
|
||||
package helloworld;
|
||||
|
||||
option go_package = "github.com/unistack-org/micro-tests/server/grpc/proto;helloworld";
|
||||
import "google/api/annotations.proto";
|
||||
option go_package = "go.unistack.org/micro-tests/server/grpc/proto;helloworld";
|
||||
import "api/annotations.proto";
|
||||
|
||||
service Test {
|
||||
rpc Call(Request) returns (Response) {
|
||||
option (google.api.http) = { post: "/api/v0/test/call/TEST"; body: "*"; };
|
||||
option (micro.api.http) = { post: "/api/v0/test/call/TEST"; body: "*"; };
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
package http
|
||||
|
||||
//go:generate sh -c "protoc -I./proto -I. -I$(go list -f '{{ .Dir }}' -m github.com/unistack-org/micro-proto) --go_out=paths=source_relative:./proto proto/test.proto"
|
||||
//go:generate sh -c "protoc -I./proto -I. -I$(go list -f '{{ .Dir }}' -m go.unistack.org/micro-proto/v3) --go_out=paths=source_relative:./proto proto/test.proto"
|
||||
|
||||
//go:generate sh -c "protoc -I./proto -I. -I$(go list -f '{{ .Dir }}' -m github.com/unistack-org/micro-proto) --go-micro_out=components='micro|http',debug=true,tag_path=./proto,paths=source_relative:./proto proto/test.proto"
|
||||
//go:generate sh -c "protoc -I./proto -I. -I$(go list -f '{{ .Dir }}' -m go.unistack.org/micro-proto/v3) --go-micro_out=components='micro|http',debug=true,tag_path=./proto,paths=source_relative:./proto proto/test.proto"
|
||||
|
@@ -4,8 +4,8 @@ import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
httpsrv "github.com/unistack-org/micro-server-http/v3"
|
||||
pb "github.com/unistack-org/micro-tests/client/http/proto"
|
||||
httpsrv "go.unistack.org/micro-server-http/v3"
|
||||
pb "go.unistack.org/micro-tests/client/http/proto"
|
||||
)
|
||||
|
||||
type GithubHandler struct{}
|
||||
|
@@ -12,22 +12,22 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
httpcli "github.com/unistack-org/micro-client-http/v3"
|
||||
jsoncodec "github.com/unistack-org/micro-codec-json/v3"
|
||||
jsonpbcodec "github.com/unistack-org/micro-codec-jsonpb/v3"
|
||||
urlencodecodec "github.com/unistack-org/micro-codec-urlencode/v3"
|
||||
xmlcodec "github.com/unistack-org/micro-codec-xml/v3"
|
||||
vmeter "github.com/unistack-org/micro-meter-victoriametrics/v3"
|
||||
httpsrv "github.com/unistack-org/micro-server-http/v3"
|
||||
pb "github.com/unistack-org/micro-tests/server/http/proto"
|
||||
"github.com/unistack-org/micro/v3/client"
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
lwrapper "github.com/unistack-org/micro/v3/logger/wrapper"
|
||||
"github.com/unistack-org/micro/v3/metadata"
|
||||
handler "github.com/unistack-org/micro/v3/meter/handler"
|
||||
mwrapper "github.com/unistack-org/micro/v3/meter/wrapper"
|
||||
"github.com/unistack-org/micro/v3/register"
|
||||
"github.com/unistack-org/micro/v3/server"
|
||||
httpcli "go.unistack.org/micro-client-http/v3"
|
||||
jsoncodec "go.unistack.org/micro-codec-json/v3"
|
||||
jsonpbcodec "go.unistack.org/micro-codec-jsonpb/v3"
|
||||
urlencodecodec "go.unistack.org/micro-codec-urlencode/v3"
|
||||
xmlcodec "go.unistack.org/micro-codec-xml/v3"
|
||||
vmeter "go.unistack.org/micro-meter-victoriametrics/v3"
|
||||
httpsrv "go.unistack.org/micro-server-http/v3"
|
||||
pb "go.unistack.org/micro-tests/server/http/proto"
|
||||
"go.unistack.org/micro/v3/client"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
lwrapper "go.unistack.org/micro/v3/logger/wrapper"
|
||||
"go.unistack.org/micro/v3/metadata"
|
||||
handler "go.unistack.org/micro/v3/meter/handler"
|
||||
mwrapper "go.unistack.org/micro/v3/meter/wrapper"
|
||||
"go.unistack.org/micro/v3/register"
|
||||
"go.unistack.org/micro/v3/server"
|
||||
wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
|
||||
)
|
||||
|
||||
@@ -36,7 +36,7 @@ type Handler struct {
|
||||
}
|
||||
|
||||
func multipartHandler(w http.ResponseWriter, r *http.Request) {
|
||||
//fmt.Printf("%#+v\n", r)
|
||||
// fmt.Printf("%#+v\n", r)
|
||||
}
|
||||
|
||||
func upload(client *http.Client, url string, values map[string]io.Reader) error {
|
||||
@@ -176,6 +176,7 @@ func (h *Handler) CallRepeatedString(ctx context.Context, req *pb.CallReq, rsp *
|
||||
httpsrv.SetRspCode(ctx, http.StatusCreated)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (h *Handler) CallRepeatedInt64(ctx context.Context, req *pb.CallReq, rsp *pb.CallRsp) error {
|
||||
if len(req.Int64Ids) != 2 || req.Int64Ids[0] != 123 {
|
||||
h.t.Fatalf("invalid reflect merging, int64_ids invalid: %v", req.Int64Ids)
|
||||
@@ -226,7 +227,7 @@ func TestNativeFormUrlencoded(t *testing.T) {
|
||||
server.Register(reg),
|
||||
server.Codec("application/json", jsoncodec.NewCodec()),
|
||||
server.Codec("application/x-www-form-urlencoded", urlencodecodec.NewCodec()),
|
||||
//server.WrapHandler(NewServerHandlerWrapper()),
|
||||
// server.WrapHandler(NewServerHandlerWrapper()),
|
||||
)
|
||||
|
||||
if err := srv.Init(); err != nil {
|
||||
@@ -266,7 +267,7 @@ func TestNativeFormUrlencoded(t *testing.T) {
|
||||
// make request
|
||||
req, err := http.NewRequest(http.MethodPost, fmt.Sprintf("http://%s/v1/test/call/my_name", service[0].Nodes[0].Address), strings.NewReader(data.Encode())) // URL-encoded payload
|
||||
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
|
||||
//req.Header.Add("Content-Length", strconv.Itoa(len(data.Encode())))
|
||||
// req.Header.Add("Content-Length", strconv.Itoa(len(data.Encode())))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -326,7 +327,6 @@ func TestNativeFormUrlencoded(t *testing.T) {
|
||||
if err := srv.Stop(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestNativeClientServer(t *testing.T) {
|
||||
@@ -479,7 +479,6 @@ func TestNativeClientServer(t *testing.T) {
|
||||
if err := srv.Stop(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestNativeServer(t *testing.T) {
|
||||
@@ -624,7 +623,6 @@ func TestNativeServer(t *testing.T) {
|
||||
if err := srv.Stop(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestHTTPHandler(t *testing.T) {
|
||||
|
@@ -1,15 +1,15 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.17.3
|
||||
// source: test.proto
|
||||
|
||||
package pb
|
||||
|
||||
import (
|
||||
_ "github.com/unistack-org/micro-proto/api"
|
||||
_ "github.com/unistack-org/micro-proto/openapiv2"
|
||||
_ "github.com/unistack-org/micro-proto/tag"
|
||||
_ "go.unistack.org/micro-proto/v3/api"
|
||||
_ "go.unistack.org/micro-proto/v3/openapiv3"
|
||||
_ "go.unistack.org/micro-proto/v3/tag"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
|
||||
@@ -377,7 +377,7 @@ var file_test_proto_rawDesc = []byte{
|
||||
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,
|
||||
0x69, 0x76, 0x33, 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,
|
||||
@@ -408,61 +408,52 @@ var file_test_proto_rawDesc = []byte{
|
||||
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, 0xa6, 0x01, 0x0a, 0x0a, 0x54, 0x65, 0x73, 0x74, 0x44, 0x6f,
|
||||
0x75, 0x62, 0x6c, 0x65, 0x12, 0x97, 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, 0x6b, 0xa2, 0x84, 0x9e, 0x03, 0x34, 0x2a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x4a, 0x2c,
|
||||
0x0a, 0x2a, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x1f, 0x12, 0x1d, 0x0a,
|
||||
0x0b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x0e, 0x45, 0x72,
|
||||
0x72, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0xb2, 0xea, 0xff, 0xf9,
|
||||
0x01, 0x24, 0x22, 0x1f, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x6f, 0x75, 0x62,
|
||||
0x6c, 0x65, 0x2f, 0x63, 0x61, 0x6c, 0x6c, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x2f, 0x7b, 0x6e, 0x61,
|
||||
0x6d, 0x65, 0x7d, 0x3a, 0x01, 0x2a, 0xba, 0xea, 0xff, 0xf9, 0x01, 0x02, 0x08, 0x05, 0x32, 0xfa,
|
||||
0x04, 0x0a, 0x04, 0x54, 0x65, 0x73, 0x74, 0x12, 0xab, 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, 0x77, 0xa2, 0x84,
|
||||
0x9e, 0x03, 0x42, 0x2a, 0x12, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65,
|
||||
0x64, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4a, 0x2c, 0x0a, 0x2a, 0x0a, 0x07, 0x64, 0x65, 0x66,
|
||||
0x61, 0x75, 0x6c, 0x74, 0x12, 0x1f, 0x12, 0x1d, 0x0a, 0x0b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e,
|
||||
0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x0e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x73,
|
||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0xb2, 0xea, 0xff, 0xf9, 0x01, 0x22, 0x22, 0x1d, 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, 0x3a, 0x01, 0x2a, 0xba, 0xea, 0xff,
|
||||
0xf9, 0x01, 0x02, 0x08, 0x05, 0x12, 0xa8, 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, 0x75, 0xa2, 0x84, 0x9e, 0x03, 0x41,
|
||||
0x2a, 0x11, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x49, 0x6e,
|
||||
0x74, 0x36, 0x34, 0x4a, 0x2c, 0x0a, 0x2a, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74,
|
||||
0x12, 0x1f, 0x12, 0x1d, 0x0a, 0x0b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x45, 0x72, 0x72, 0x6f,
|
||||
0x72, 0x12, 0x0e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||
0x65, 0xb2, 0xea, 0xff, 0xf9, 0x01, 0x21, 0x22, 0x1c, 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, 0x3a, 0x01, 0x2a, 0xba, 0xea, 0xff, 0xf9, 0x01, 0x02, 0x08, 0x05,
|
||||
0x12, 0x86, 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, 0x60, 0xa2, 0x84, 0x9e, 0x03, 0x34, 0x2a, 0x04,
|
||||
0x43, 0x61, 0x6c, 0x6c, 0x4a, 0x2c, 0x0a, 0x2a, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c,
|
||||
0x74, 0x12, 0x1f, 0x12, 0x1d, 0x0a, 0x0b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x45, 0x72, 0x72,
|
||||
0x6f, 0x72, 0x12, 0x0e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||
0x73, 0x65, 0xb2, 0xea, 0xff, 0xf9, 0x01, 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, 0x8f, 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, 0x62, 0xa2, 0x84, 0x9e, 0x03, 0x39, 0x2a, 0x09,
|
||||
0x43, 0x61, 0x6c, 0x6c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4a, 0x2c, 0x0a, 0x2a, 0x0a, 0x07, 0x64,
|
||||
0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x1f, 0x12, 0x1d, 0x0a, 0x0b, 0x2e, 0x74, 0x65, 0x73,
|
||||
0x74, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x0e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x20, 0x72,
|
||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0xb2, 0xea, 0xff, 0xf9, 0x01, 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,
|
||||
0x52, 0x03, 0x6d, 0x73, 0x67, 0x32, 0x8a, 0x01, 0x0a, 0x0a, 0x54, 0x65, 0x73, 0x74, 0x44, 0x6f,
|
||||
0x75, 0x62, 0x6c, 0x65, 0x12, 0x7c, 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, 0x50, 0xaa, 0x84, 0x9e, 0x03, 0x19, 0x2a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x42, 0x11, 0x0a,
|
||||
0x0f, 0x12, 0x0d, 0x0a, 0x0b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72,
|
||||
0xb2, 0xea, 0xff, 0xf9, 0x01, 0x24, 0x22, 0x1f, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, 0x73, 0x74,
|
||||
0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x2f, 0x63, 0x61, 0x6c, 0x6c, 0x2f, 0x6e, 0x61, 0x6d, 0x65,
|
||||
0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x3a, 0x01, 0x2a, 0xba, 0xea, 0xff, 0xf9, 0x01, 0x02,
|
||||
0x08, 0x05, 0x32, 0x8c, 0x04, 0x0a, 0x04, 0x54, 0x65, 0x73, 0x74, 0x12, 0x90, 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, 0x5c, 0xaa, 0x84, 0x9e, 0x03, 0x27, 0x2a, 0x12, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x70,
|
||||
0x65, 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x11, 0x0a, 0x0f, 0x12,
|
||||
0x0d, 0x0a, 0x0b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0xb2, 0xea,
|
||||
0xff, 0xf9, 0x01, 0x22, 0x22, 0x1d, 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, 0x3a, 0x01, 0x2a, 0xba, 0xea, 0xff, 0xf9, 0x01, 0x02, 0x08, 0x05, 0x12, 0x8d,
|
||||
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, 0x5a, 0xaa, 0x84, 0x9e, 0x03, 0x26, 0x2a, 0x11, 0x43, 0x61, 0x6c, 0x6c, 0x52,
|
||||
0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x42, 0x11, 0x0a, 0x0f,
|
||||
0x12, 0x0d, 0x0a, 0x0b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0xb2,
|
||||
0xea, 0xff, 0xf9, 0x01, 0x21, 0x22, 0x1c, 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, 0x3a, 0x01, 0x2a, 0xba, 0xea, 0xff, 0xf9, 0x01, 0x02, 0x08, 0x05, 0x12, 0x6b,
|
||||
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, 0x45, 0xaa, 0x84, 0x9e, 0x03, 0x19, 0x2a, 0x04, 0x43, 0x61, 0x6c,
|
||||
0x6c, 0x42, 0x11, 0x0a, 0x0f, 0x12, 0x0d, 0x0a, 0x0b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x45,
|
||||
0x72, 0x72, 0x6f, 0x72, 0xb2, 0xea, 0xff, 0xf9, 0x01, 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, 0x74, 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, 0x47, 0xaa, 0x84, 0x9e, 0x03, 0x1e, 0x2a,
|
||||
0x09, 0x43, 0x61, 0x6c, 0x6c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x42, 0x11, 0x0a, 0x0f, 0x12, 0x0d,
|
||||
0x0a, 0x0b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0xb2, 0xea, 0xff,
|
||||
0xf9, 0x01, 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, 0x32, 0x5a, 0x30, 0x67, 0x6f, 0x2e, 0x75, 0x6e, 0x69, 0x73, 0x74, 0x61, 0x63, 0x6b,
|
||||
0x2e, 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 (
|
||||
|
@@ -2,26 +2,22 @@ syntax = "proto3";
|
||||
|
||||
package test;
|
||||
|
||||
option go_package = "github.com/unistack-org/micro-tests/server/http/proto;pb";
|
||||
option go_package = "go.unistack.org/micro-tests/server/http/proto;pb";
|
||||
|
||||
import "tag/tag.proto";
|
||||
import "api/annotations.proto";
|
||||
import "openapiv2/annotations.proto";
|
||||
import "openapiv3/annotations.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
|
||||
service TestDouble {
|
||||
//option (micro.api.micro_service) = { client_wrappers: ["one","two"]; };
|
||||
rpc CallDouble(CallReq) returns (CallRsp) {
|
||||
option (micro.openapiv2.openapiv2_operation) = {
|
||||
option (micro.openapiv3.openapiv3_operation) = {
|
||||
operation_id: "Call";
|
||||
responses: {
|
||||
response_code: {
|
||||
name: "default";
|
||||
value: {
|
||||
json_reference: {
|
||||
description: "Error response";
|
||||
_ref: ".test.Error";
|
||||
};
|
||||
default: {
|
||||
reference: {
|
||||
_ref: ".test.Error";
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -33,16 +29,12 @@ service TestDouble {
|
||||
|
||||
service Test {
|
||||
rpc CallRepeatedString(CallReq) returns (CallRsp) {
|
||||
option (micro.openapiv2.openapiv2_operation) = {
|
||||
option (micro.openapiv3.openapiv3_operation) = {
|
||||
operation_id: "CallRepeatedString";
|
||||
responses: {
|
||||
response_code: {
|
||||
name: "default";
|
||||
value: {
|
||||
json_reference: {
|
||||
description: "Error response";
|
||||
_ref: ".test.Error";
|
||||
};
|
||||
default: {
|
||||
reference: {
|
||||
_ref: ".test.Error";
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -51,16 +43,12 @@ service Test {
|
||||
option (micro.api.micro_method) = { timeout: 5; };
|
||||
};
|
||||
rpc CallRepeatedInt64(CallReq) returns (CallRsp) {
|
||||
option (micro.openapiv2.openapiv2_operation) = {
|
||||
option (micro.openapiv3.openapiv3_operation) = {
|
||||
operation_id: "CallRepeatedInt64";
|
||||
responses: {
|
||||
response_code: {
|
||||
name: "default";
|
||||
value: {
|
||||
json_reference: {
|
||||
description: "Error response";
|
||||
_ref: ".test.Error";
|
||||
};
|
||||
default: {
|
||||
reference: {
|
||||
_ref: ".test.Error";
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -72,16 +60,12 @@ service Test {
|
||||
|
||||
//option (micro.api.micro_service) = { client_wrappers: ["one","two"]; };
|
||||
rpc Call(CallReq) returns (CallRsp) {
|
||||
option (micro.openapiv2.openapiv2_operation) = {
|
||||
option (micro.openapiv3.openapiv3_operation) = {
|
||||
operation_id: "Call";
|
||||
responses: {
|
||||
response_code: {
|
||||
name: "default";
|
||||
value: {
|
||||
json_reference: {
|
||||
description: "Error response";
|
||||
_ref: ".test.Error";
|
||||
};
|
||||
default: {
|
||||
reference: {
|
||||
_ref: ".test.Error";
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -90,16 +74,12 @@ service Test {
|
||||
option (micro.api.micro_method) = { timeout: 5; };
|
||||
};
|
||||
rpc CallError(CallReq1) returns (CallRsp1) {
|
||||
option (micro.openapiv2.openapiv2_operation) = {
|
||||
option (micro.openapiv3.openapiv3_operation) = {
|
||||
operation_id: "CallError";
|
||||
responses: {
|
||||
response_code: {
|
||||
name: "default";
|
||||
value: {
|
||||
json_reference: {
|
||||
description: "Error response";
|
||||
_ref: ".test.Error";
|
||||
};
|
||||
default: {
|
||||
reference: {
|
||||
_ref: ".test.Error";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@@ -1,13 +1,13 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// protoc-gen-go-micro version: v3.4.2
|
||||
// protoc-gen-go-micro version: v3.5.3
|
||||
// source: test.proto
|
||||
|
||||
package pb
|
||||
|
||||
import (
|
||||
context "context"
|
||||
api "github.com/unistack-org/micro/v3/api"
|
||||
client "github.com/unistack-org/micro/v3/client"
|
||||
api "go.unistack.org/micro/v3/api"
|
||||
client "go.unistack.org/micro/v3/client"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@@ -1,15 +1,15 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// protoc-gen-go-micro version: v3.4.2
|
||||
// protoc-gen-go-micro version: v3.5.3
|
||||
// source: test.proto
|
||||
|
||||
package pb
|
||||
|
||||
import (
|
||||
context "context"
|
||||
v3 "github.com/unistack-org/micro-client-http/v3"
|
||||
api "github.com/unistack-org/micro/v3/api"
|
||||
client "github.com/unistack-org/micro/v3/client"
|
||||
server "github.com/unistack-org/micro/v3/server"
|
||||
v3 "go.unistack.org/micro-client-http/v3"
|
||||
api "go.unistack.org/micro/v3/api"
|
||||
client "go.unistack.org/micro/v3/client"
|
||||
server "go.unistack.org/micro/v3/server"
|
||||
http "net/http"
|
||||
time "time"
|
||||
)
|
||||
@@ -24,11 +24,6 @@ func NewTestDoubleClient(name string, c client.Client) TestDoubleClient {
|
||||
}
|
||||
|
||||
func (c *testDoubleClient) CallDouble(ctx context.Context, req *CallReq, opts ...client.CallOption) (*CallRsp, error) {
|
||||
errmap := make(map[string]interface{}, 1)
|
||||
errmap["default"] = &Error{}
|
||||
opts = append(opts,
|
||||
v3.ErrorMap(errmap),
|
||||
)
|
||||
opts = append(opts,
|
||||
v3.Method(http.MethodPost),
|
||||
v3.Path("/v1/testdouble/call/name/{name}"),
|
||||
@@ -79,11 +74,6 @@ func NewTestClient(name string, c client.Client) TestClient {
|
||||
}
|
||||
|
||||
func (c *testClient) CallRepeatedString(ctx context.Context, req *CallReq, opts ...client.CallOption) (*CallRsp, error) {
|
||||
errmap := make(map[string]interface{}, 1)
|
||||
errmap["default"] = &Error{}
|
||||
opts = append(opts,
|
||||
v3.ErrorMap(errmap),
|
||||
)
|
||||
opts = append(opts,
|
||||
v3.Method(http.MethodPost),
|
||||
v3.Path("/v1/test/call_repeated_string"),
|
||||
@@ -99,11 +89,6 @@ func (c *testClient) CallRepeatedString(ctx context.Context, req *CallReq, opts
|
||||
}
|
||||
|
||||
func (c *testClient) CallRepeatedInt64(ctx context.Context, req *CallReq, opts ...client.CallOption) (*CallRsp, error) {
|
||||
errmap := make(map[string]interface{}, 1)
|
||||
errmap["default"] = &Error{}
|
||||
opts = append(opts,
|
||||
v3.ErrorMap(errmap),
|
||||
)
|
||||
opts = append(opts,
|
||||
v3.Method(http.MethodPost),
|
||||
v3.Path("/v1/test/call_repeated_int64"),
|
||||
@@ -119,11 +104,6 @@ func (c *testClient) CallRepeatedInt64(ctx context.Context, req *CallReq, opts .
|
||||
}
|
||||
|
||||
func (c *testClient) Call(ctx context.Context, req *CallReq, opts ...client.CallOption) (*CallRsp, error) {
|
||||
errmap := make(map[string]interface{}, 1)
|
||||
errmap["default"] = &Error{}
|
||||
opts = append(opts,
|
||||
v3.ErrorMap(errmap),
|
||||
)
|
||||
opts = append(opts,
|
||||
v3.Method(http.MethodPost),
|
||||
v3.Path("/v1/test/call/{name}"),
|
||||
@@ -139,11 +119,6 @@ func (c *testClient) Call(ctx context.Context, req *CallReq, opts ...client.Call
|
||||
}
|
||||
|
||||
func (c *testClient) CallError(ctx context.Context, req *CallReq1, opts ...client.CallOption) (*CallRsp1, error) {
|
||||
errmap := make(map[string]interface{}, 1)
|
||||
errmap["default"] = &Error{}
|
||||
opts = append(opts,
|
||||
v3.ErrorMap(errmap),
|
||||
)
|
||||
opts = append(opts,
|
||||
v3.Method(http.MethodPost),
|
||||
v3.Path("/v1/test/callerror/{name}"),
|
||||
|
@@ -1,7 +0,0 @@
|
||||
// +build tools
|
||||
|
||||
package http
|
||||
|
||||
import (
|
||||
_ "github.com/unistack-org/micro-proto/openapiv2"
|
||||
)
|
@@ -8,11 +8,11 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
tcp "github.com/unistack-org/micro-server-tcp/v3"
|
||||
"github.com/unistack-org/micro/v3/broker"
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"github.com/unistack-org/micro/v3/register"
|
||||
"github.com/unistack-org/micro/v3/server"
|
||||
tcp "go.unistack.org/micro-server-tcp/v3"
|
||||
"go.unistack.org/micro/v3/broker"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
"go.unistack.org/micro/v3/register"
|
||||
"go.unistack.org/micro/v3/server"
|
||||
)
|
||||
|
||||
type testHandler struct {
|
||||
|
Reference in New Issue
Block a user