Compare commits
7 Commits
dependabot
...
master
Author | SHA1 | Date | |
---|---|---|---|
aa3702e988 | |||
00e71fc9ec | |||
6d0b6f30bb | |||
fe6ee6b4ac | |||
23113d8c9f | |||
c514f9891e | |||
288d16a6f0 |
@ -16,11 +16,11 @@ import (
|
||||
segmentio "go.unistack.org/micro-broker-segmentio/v3"
|
||||
victoriameter "go.unistack.org/micro-meter-victoriametrics/v3"
|
||||
https "go.unistack.org/micro-server-http/v3"
|
||||
meterhandler "go.unistack.org/micro-server-http/v3/handler/meter"
|
||||
"go.unistack.org/micro/v3/broker"
|
||||
"go.unistack.org/micro/v3/codec"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
"go.unistack.org/micro/v3/meter"
|
||||
meterhandler "go.unistack.org/micro/v3/meter/handler"
|
||||
"go.unistack.org/micro/v3/server"
|
||||
)
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-micro v3.10.1
|
||||
// - protoc-gen-go-micro v3.10.2
|
||||
// - protoc v3.21.12
|
||||
// source: test.proto
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// protoc-gen-go-micro version: v3.10.1
|
||||
// protoc-gen-go-micro version: v3.10.2
|
||||
// source: test.proto
|
||||
|
||||
package pb
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-micro v3.10.1
|
||||
// - protoc-gen-go-micro v3.10.2
|
||||
// - protoc v3.21.12
|
||||
// source: test.proto
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// protoc-gen-go-micro version: v3.10.1
|
||||
// protoc-gen-go-micro version: v3.10.2
|
||||
// source: test.proto
|
||||
|
||||
package helloworld
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc v3.21.12
|
||||
// source: test.proto
|
||||
|
||||
@ -18,6 +18,11 @@ import (
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
Test_Call_FullMethodName = "/helloworld.Test/Call"
|
||||
Test_Stream_FullMethodName = "/helloworld.Test/Stream"
|
||||
)
|
||||
|
||||
// TestClient is the client API for Test service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
@ -36,7 +41,7 @@ func NewTestClient(cc grpc.ClientConnInterface) TestClient {
|
||||
|
||||
func (c *testClient) Call(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/helloworld.Test/Call", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, Test_Call_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -44,7 +49,7 @@ func (c *testClient) Call(ctx context.Context, in *Request, opts ...grpc.CallOpt
|
||||
}
|
||||
|
||||
func (c *testClient) Stream(ctx context.Context, opts ...grpc.CallOption) (Test_StreamClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &Test_ServiceDesc.Streams[0], "/helloworld.Test/Stream", opts...)
|
||||
stream, err := c.cc.NewStream(ctx, &Test_ServiceDesc.Streams[0], Test_Stream_FullMethodName, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -116,7 +121,7 @@ func _Test_Call_Handler(srv interface{}, ctx context.Context, dec func(interface
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/helloworld.Test/Call",
|
||||
FullMethod: Test_Call_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TestServer).Call(ctx, req.(*Request))
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-micro v3.10.1
|
||||
// - protoc-gen-go-micro v3.10.2
|
||||
// - protoc v3.21.12
|
||||
// source: github.proto
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// protoc-gen-go-micro version: v3.10.1
|
||||
// protoc-gen-go-micro version: v3.10.2
|
||||
// source: github.proto
|
||||
|
||||
package pb
|
||||
|
66
client/mock/mock_test.go
Normal file
66
client/mock/mock_test.go
Normal file
@ -0,0 +1,66 @@
|
||||
package mock
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"go.unistack.org/micro-client-mock/v3"
|
||||
jsoncodec "go.unistack.org/micro-codec-json/v3"
|
||||
pb "go.unistack.org/micro-tests/client/mock/proto"
|
||||
"go.unistack.org/micro/v3/client"
|
||||
"go.unistack.org/micro/v3/errors"
|
||||
)
|
||||
|
||||
func TestCallWithoutError(t *testing.T) {
|
||||
c := mock.NewClient(client.ContentType("application/json"), client.Codec("application/json", jsoncodec.NewCodec()))
|
||||
|
||||
if err := c.Init(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
reqbuf := []byte(`{"username": "vtolstov"}`)
|
||||
rspbuf := []byte(`{"name": "Vasiliy Tolstov"}`)
|
||||
er := c.ExpectRequest(c.NewRequest("github", "Github.LookupUser", reqbuf))
|
||||
er.WillReturnResponse("application/json", rspbuf)
|
||||
er.WillDelayFor(10 * time.Millisecond)
|
||||
|
||||
gh := pb.NewGithubClient("github", c)
|
||||
|
||||
rsp, err := gh.LookupUser(context.TODO(), &pb.LookupUserReq{Username: "vtolstov"})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if rsp.Name != "Vasiliy Tolstov" {
|
||||
t.Fatalf("invalid rsp received: %#+v\n", rsp)
|
||||
}
|
||||
|
||||
if err := c.ExpectationsWereMet(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCallWithtError(t *testing.T) {
|
||||
c := mock.NewClient(client.ContentType("application/json"), client.Codec("application/json", jsoncodec.NewCodec()))
|
||||
|
||||
if err := c.Init(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
reqbuf := []byte(`{"username": "vtolstov"}`)
|
||||
rspbuf := []byte(`{"name": "Vasiliy Tolstov"}`)
|
||||
er := c.ExpectRequest(c.NewRequest("github", "Github.LookupUser", reqbuf))
|
||||
er.WillReturnResponse("application/json", rspbuf)
|
||||
er.WillDelayFor(10 * time.Millisecond)
|
||||
er.WillReturnError(errors.InternalServerError("test", "internal server error"))
|
||||
|
||||
gh := pb.NewGithubClient("github", c)
|
||||
|
||||
rsp, err := gh.LookupUser(context.TODO(), &pb.LookupUserReq{Username: "vtolstov"})
|
||||
if err == nil || rsp != nil {
|
||||
t.Fatal("call must return error")
|
||||
}
|
||||
|
||||
if err := c.ExpectationsWereMet(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
19
client/mock/proto/github.pb.go
Normal file
19
client/mock/proto/github.pb.go
Normal file
@ -0,0 +1,19 @@
|
||||
package pb
|
||||
|
||||
import (
|
||||
_ "go.unistack.org/micro-proto/v3/api"
|
||||
_ "go.unistack.org/micro-proto/v3/openapiv3"
|
||||
)
|
||||
|
||||
type LookupUserReq struct {
|
||||
Username string `json:"username,omitempty"`
|
||||
}
|
||||
|
||||
type LookupUserRsp struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
}
|
||||
|
||||
type Error struct {
|
||||
Message string `json:"message,omitempty"`
|
||||
DocumentationUrl string `json:"documentation_url,omitempty"`
|
||||
}
|
28
client/mock/proto/github_micro.pb.go
Normal file
28
client/mock/proto/github_micro.pb.go
Normal file
@ -0,0 +1,28 @@
|
||||
package pb
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
v3 "go.unistack.org/micro-server-http/v3"
|
||||
client "go.unistack.org/micro/v3/client"
|
||||
)
|
||||
|
||||
var GithubName = "Github"
|
||||
|
||||
var GithubServerEndpoints = []v3.EndpointMetadata{
|
||||
{
|
||||
Name: "Github.LookupUser",
|
||||
Path: "/users/{username}",
|
||||
Method: "GET",
|
||||
Body: "",
|
||||
Stream: false,
|
||||
},
|
||||
}
|
||||
|
||||
type GithubClient interface {
|
||||
LookupUser(ctx context.Context, req *LookupUserReq, opts ...client.CallOption) (*LookupUserRsp, error)
|
||||
}
|
||||
|
||||
type GithubServer interface {
|
||||
LookupUser(ctx context.Context, req *LookupUserReq, rsp *LookupUserRsp) error
|
||||
}
|
59
client/mock/proto/github_micro_http.pb.go
Normal file
59
client/mock/proto/github_micro_http.pb.go
Normal file
@ -0,0 +1,59 @@
|
||||
package pb
|
||||
|
||||
import (
|
||||
context "context"
|
||||
http "net/http"
|
||||
|
||||
v3 "go.unistack.org/micro-client-http/v3"
|
||||
v31 "go.unistack.org/micro-server-http/v3"
|
||||
client "go.unistack.org/micro/v3/client"
|
||||
server "go.unistack.org/micro/v3/server"
|
||||
)
|
||||
|
||||
type githubClient struct {
|
||||
c client.Client
|
||||
name string
|
||||
}
|
||||
|
||||
func NewGithubClient(name string, c client.Client) GithubClient {
|
||||
return &githubClient{c: c, name: name}
|
||||
}
|
||||
|
||||
func (c *githubClient) LookupUser(ctx context.Context, req *LookupUserReq, opts ...client.CallOption) (*LookupUserRsp, error) {
|
||||
errmap := make(map[string]interface{}, 1)
|
||||
errmap["default"] = &Error{}
|
||||
opts = append(opts,
|
||||
v3.ErrorMap(errmap),
|
||||
)
|
||||
opts = append(opts,
|
||||
v3.Method(http.MethodGet),
|
||||
v3.Path("/users/{username}"),
|
||||
)
|
||||
rsp := &LookupUserRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "Github.LookupUser", req), rsp, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rsp, nil
|
||||
}
|
||||
|
||||
type githubServer struct {
|
||||
GithubServer
|
||||
}
|
||||
|
||||
func (h *githubServer) LookupUser(ctx context.Context, req *LookupUserReq, rsp *LookupUserRsp) error {
|
||||
return h.GithubServer.LookupUser(ctx, req, rsp)
|
||||
}
|
||||
|
||||
func RegisterGithubServer(s server.Server, sh GithubServer, opts ...server.HandlerOption) error {
|
||||
type github interface {
|
||||
LookupUser(ctx context.Context, req *LookupUserReq, rsp *LookupUserRsp) error
|
||||
}
|
||||
type Github struct {
|
||||
github
|
||||
}
|
||||
h := &githubServer{sh}
|
||||
var nopts []server.HandlerOption
|
||||
nopts = append(nopts, v31.HandlerEndpoints(GithubServerEndpoints))
|
||||
return s.Handle(s.NewHandler(&Github{h}, append(nopts, opts...)...))
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-micro v3.10.1
|
||||
// - protoc-gen-go-micro v3.10.2
|
||||
// - protoc v3.21.12
|
||||
// source: test.proto
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// protoc-gen-go-micro version: v3.10.1
|
||||
// protoc-gen-go-micro version: v3.10.2
|
||||
// source: test.proto
|
||||
|
||||
package pb
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-micro v3.10.1
|
||||
// - protoc-gen-go-micro v3.10.2
|
||||
// - protoc v3.21.12
|
||||
// source: test.proto
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// protoc-gen-go-micro version: v3.10.1
|
||||
// protoc-gen-go-micro version: v3.10.2
|
||||
// source: test.proto
|
||||
|
||||
package pb
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-micro v3.10.1
|
||||
// - protoc-gen-go-micro v3.10.2
|
||||
// - protoc v3.21.12
|
||||
// source: test.proto
|
||||
|
||||
|
@ -1,11 +1,10 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// protoc-gen-go-micro version: v3.10.1
|
||||
// protoc-gen-go-micro version: v3.10.2
|
||||
// source: test.proto
|
||||
|
||||
package pb
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
context "context"
|
||||
v3 "go.unistack.org/micro-client-http/v3"
|
||||
v31 "go.unistack.org/micro-server-http/v3"
|
||||
@ -39,7 +38,6 @@ func (c *testServiceClient) LookupUser(ctx context.Context, req *LookupUserReq,
|
||||
rsp := &LookupUserRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "TestService.LookupUser", req), rsp, opts...)
|
||||
if err != nil {
|
||||
fmt.Printf("AAA1 %v\n", err)
|
||||
return nil, err
|
||||
}
|
||||
return rsp, nil
|
||||
@ -61,7 +59,6 @@ func (c *testServiceClient) UpdateUser(ctx context.Context, req *UpdateUserReq,
|
||||
rsp := &UpdateUserRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "TestService.UpdateUser", req), rsp, opts...)
|
||||
if err != nil {
|
||||
fmt.Printf("AAA2 %v\n", err)
|
||||
return nil, err
|
||||
}
|
||||
return rsp, nil
|
||||
@ -82,7 +79,6 @@ func (c *testServiceClient) DeleteUser(ctx context.Context, req *DeleteUserReq,
|
||||
rsp := &DeleteUserRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "TestService.DeleteUser", req), rsp, opts...)
|
||||
if err != nil {
|
||||
fmt.Printf("AAA3 %v\n", err)
|
||||
return nil, err
|
||||
}
|
||||
return rsp, nil
|
||||
@ -104,7 +100,6 @@ func (c *testServiceClient) MailUser(ctx context.Context, req *MailUserReq, opts
|
||||
rsp := &MailUserRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "TestService.MailUser", req), rsp, opts...)
|
||||
if err != nil {
|
||||
fmt.Printf("AAA4 %v\n", err)
|
||||
return nil, err
|
||||
}
|
||||
return rsp, nil
|
||||
|
56
go.mod
56
go.mod
@ -1,6 +1,6 @@
|
||||
module go.unistack.org/micro-tests
|
||||
|
||||
go 1.18
|
||||
go 1.19
|
||||
|
||||
require (
|
||||
github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect
|
||||
@ -15,7 +15,7 @@ require (
|
||||
github.com/hashicorp/vault/api v1.9.0 // indirect
|
||||
github.com/jmoiron/sqlx v1.3.5
|
||||
github.com/opentracing/opentracing-go v1.2.0
|
||||
github.com/segmentio/kafka-go v0.4.38
|
||||
github.com/segmentio/kafka-go v0.4.39
|
||||
github.com/stretchr/testify v1.8.1
|
||||
github.com/twmb/franz-go v1.12.1
|
||||
github.com/uber/jaeger-client-go v2.30.0+incompatible
|
||||
@ -26,13 +26,13 @@ require (
|
||||
go.unistack.org/micro-broker-segmentio/v3 v3.8.0
|
||||
go.unistack.org/micro-client-grpc/v3 v3.10.0
|
||||
go.unistack.org/micro-client-http/v3 v3.9.0
|
||||
go.unistack.org/micro-codec-grpc/v3 v3.8.1
|
||||
go.unistack.org/micro-codec-json/v3 v3.8.0
|
||||
go.unistack.org/micro-codec-jsonpb/v3 v3.8.1
|
||||
go.unistack.org/micro-codec-proto/v3 v3.8.1
|
||||
go.unistack.org/micro-codec-segmentio/v3 v3.8.1
|
||||
go.unistack.org/micro-codec-urlencode/v3 v3.8.1
|
||||
go.unistack.org/micro-codec-xml/v3 v3.8.1
|
||||
go.unistack.org/micro-codec-grpc/v3 v3.10.0
|
||||
go.unistack.org/micro-codec-json/v3 v3.10.0
|
||||
go.unistack.org/micro-codec-jsonpb/v3 v3.10.0
|
||||
go.unistack.org/micro-codec-proto/v3 v3.10.0
|
||||
go.unistack.org/micro-codec-segmentio/v3 v3.10.0
|
||||
go.unistack.org/micro-codec-urlencode/v3 v3.10.0
|
||||
go.unistack.org/micro-codec-xml/v3 v3.10.0
|
||||
go.unistack.org/micro-config-consul/v3 v3.8.2
|
||||
go.unistack.org/micro-config-env/v3 v3.8.3
|
||||
go.unistack.org/micro-config-vault/v3 v3.8.4
|
||||
@ -40,22 +40,27 @@ require (
|
||||
go.unistack.org/micro-meter-victoriametrics/v3 v3.8.6
|
||||
go.unistack.org/micro-proto/v3 v3.3.1
|
||||
go.unistack.org/micro-router-register/v3 v3.9.0
|
||||
go.unistack.org/micro-server-grpc/v3 v3.10.1
|
||||
go.unistack.org/micro-server-http/v3 v3.10.11
|
||||
go.unistack.org/micro-server-grpc/v3 v3.10.3
|
||||
go.unistack.org/micro-server-http/v3 v3.10.12
|
||||
go.unistack.org/micro-server-tcp/v3 v3.10.0
|
||||
go.unistack.org/micro-tracer-opentracing/v3 v3.10.1
|
||||
go.unistack.org/micro-wrapper-recovery/v3 v3.8.3
|
||||
go.unistack.org/micro-wrapper-sql/v3 v3.10.3
|
||||
go.unistack.org/micro/v3 v3.10.14
|
||||
golang.org/x/crypto v0.6.0 // indirect
|
||||
go.unistack.org/micro/v3 v3.10.18
|
||||
golang.org/x/crypto v0.7.0 // indirect
|
||||
golang.org/x/time v0.3.0 // indirect
|
||||
google.golang.org/genproto v0.0.0-20230216225411-c8e22ba71e44 // indirect
|
||||
google.golang.org/genproto v0.0.0-20230303212802-e74f57abe488 // indirect
|
||||
google.golang.org/grpc v1.53.0
|
||||
google.golang.org/protobuf v1.28.1
|
||||
modernc.org/sqlite v1.20.3
|
||||
storj.io/drpc v0.0.32
|
||||
)
|
||||
|
||||
require (
|
||||
go.unistack.org/micro-client-mock/v3 v3.0.1
|
||||
golang.org/x/net v0.8.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/cenkalti/backoff/v3 v3.2.2 // indirect
|
||||
@ -65,7 +70,7 @@ require (
|
||||
github.com/golang/protobuf v1.5.2 // indirect
|
||||
github.com/google/gnostic v0.6.9 // indirect
|
||||
github.com/google/uuid v1.3.0 // indirect
|
||||
github.com/hashicorp/consul/api v1.18.0 // indirect
|
||||
github.com/hashicorp/consul/api v1.19.1 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
|
||||
@ -77,38 +82,33 @@ require (
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/hashicorp/serf v0.10.1 // indirect
|
||||
github.com/imdario/mergo v0.3.13 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
|
||||
github.com/klauspost/compress v1.15.15 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.0.6 // indirect
|
||||
github.com/klauspost/compress v1.16.0 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.17 // indirect
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
|
||||
github.com/pierrec/lz4/v4 v4.1.17 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/prometheus/client_golang v1.14.0 // indirect
|
||||
github.com/prometheus/client_model v0.3.0 // indirect
|
||||
github.com/prometheus/common v0.40.0 // indirect
|
||||
github.com/prometheus/common v0.41.0 // indirect
|
||||
github.com/prometheus/procfs v0.9.0 // indirect
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
|
||||
github.com/ryanuber/go-glob v1.0.0 // indirect
|
||||
github.com/segmentio/asm v1.0.1 // indirect
|
||||
github.com/segmentio/encoding v0.2.21 // indirect
|
||||
github.com/segmentio/asm v1.2.0 // indirect
|
||||
github.com/segmentio/encoding v0.3.6 // indirect
|
||||
github.com/silas/dag v0.0.0-20211117232152-9d50aa809f35 // indirect
|
||||
github.com/twmb/franz-go/pkg/kmsg v1.4.0 // indirect
|
||||
github.com/valyala/fastrand v1.1.0 // indirect
|
||||
github.com/valyala/histogram v1.2.0 // indirect
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
|
||||
golang.org/x/net v0.7.0 // indirect
|
||||
golang.org/x/sys v0.5.0 // indirect
|
||||
golang.org/x/text v0.7.0 // indirect
|
||||
golang.org/x/tools v0.1.12 // indirect
|
||||
golang.org/x/mod v0.8.0 // indirect
|
||||
golang.org/x/sys v0.6.0 // indirect
|
||||
golang.org/x/text v0.8.0 // indirect
|
||||
golang.org/x/tools v0.6.0 // indirect
|
||||
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
lukechampine.com/uint128 v1.2.0 // indirect
|
||||
|
112
go.sum
112
go.sum
@ -562,10 +562,11 @@ github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqE
|
||||
github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY=
|
||||
github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
|
||||
github.com/hashicorp/consul/api v1.18.0 h1:R7PPNzTCeN6VuQNDwwhZWJvzCtGSrNpJqfb22h3yH9g=
|
||||
github.com/hashicorp/consul/api v1.18.0/go.mod h1:owRRGJ9M5xReDC5nfT8FTJrNAPbT4NM6p/k+d03q2v4=
|
||||
github.com/hashicorp/consul/sdk v0.13.0 h1:lce3nFlpv8humJL8rNrrGHYSKc3q+Kxfeg3Ii1m6ZWU=
|
||||
github.com/hashicorp/consul/api v1.19.1 h1:GLeK1WD4VIRvt4wRhQKHFudztEkRb8pDs+uRiJgNwes=
|
||||
github.com/hashicorp/consul/api v1.19.1/go.mod h1:jAt316eYgWGNLJtxkMQrcqRpuDE/kFJdqkEFwRXFv8U=
|
||||
github.com/hashicorp/consul/sdk v0.13.0/go.mod h1:0hs/l5fOVhJy/VdcoaNqUSi2AUs95eF5WKtv+EYIQqE=
|
||||
github.com/hashicorp/consul/sdk v0.13.1 h1:EygWVWWMczTzXGpO93awkHFzfUka6hLYJ0qhETd+6lY=
|
||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
|
||||
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
@ -653,7 +654,6 @@ github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV
|
||||
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
||||
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
|
||||
@ -665,10 +665,8 @@ github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:C
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/klauspost/compress v1.9.8/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
|
||||
github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU=
|
||||
github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw=
|
||||
github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4=
|
||||
github.com/klauspost/cpuid/v2 v2.0.6 h1:dQ5ueTiftKxp0gyjKSx5+8BtPWkyQbd95m8Gys/RarI=
|
||||
github.com/klauspost/cpuid/v2 v2.0.6/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
|
||||
github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4=
|
||||
github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
||||
@ -721,11 +719,9 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua
|
||||
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||
github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
|
||||
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||
@ -771,8 +767,8 @@ github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8b
|
||||
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
|
||||
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
|
||||
github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
|
||||
github.com/prometheus/common v0.40.0 h1:Afz7EVRqGg2Mqqf4JuF9vdvp1pi220m55Pi9T2JnO4Q=
|
||||
github.com/prometheus/common v0.40.0/go.mod h1:L65ZJPSmfn/UBWLQIHV7dBrKFidB/wPlF1y5TlSt9OE=
|
||||
github.com/prometheus/common v0.41.0 h1:npo01n6vUlRViIj5fgwiK8vlNIh8bnoxqh3gypKsyAw=
|
||||
github.com/prometheus/common v0.41.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc=
|
||||
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
||||
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
|
||||
@ -791,13 +787,14 @@ github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkB
|
||||
github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc=
|
||||
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I=
|
||||
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
|
||||
github.com/segmentio/asm v1.0.1 h1:g9VK62hXylgXI4yJV+dLTu/1j7kTxG9bkUSYBxL9dpg=
|
||||
github.com/segmentio/asm v1.0.1/go.mod h1:4EUJGaKsB8ImLUwOGORVsNd9vTRDeh44JGsY4aKp5I4=
|
||||
github.com/segmentio/encoding v0.2.21 h1:hlRQz3Pv+/mBj+jqr46TVqqv6AuTwvP5aAxQ0Usd4gY=
|
||||
github.com/segmentio/encoding v0.2.21/go.mod h1:kF1db1oBuYxMvLR3RXrZJchRdBKrS+1J/hL63p5hekI=
|
||||
github.com/segmentio/asm v1.1.3/go.mod h1:Ld3L4ZXGNcSLRg4JBsZ3//1+f/TjYl0Mzen/DQy1EJg=
|
||||
github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys=
|
||||
github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs=
|
||||
github.com/segmentio/encoding v0.3.6 h1:E6lVLyDPseWEulBmCmAKPanDd3jiyGDo5gMcugCRwZQ=
|
||||
github.com/segmentio/encoding v0.3.6/go.mod h1:n0JeuIqEQrQoPDGsjo8UNd1iA0U8d8+oHAA4E3G3OxM=
|
||||
github.com/segmentio/kafka-go v0.4.22/go.mod h1:XzMcoMjSzDGHcIwpWUI7GB43iKZ2fTVmryPSGLf/MPg=
|
||||
github.com/segmentio/kafka-go v0.4.38 h1:iQdOBbUSdfuYlFpvjuALgj7N6DrdPA0HfB4AhREOdtg=
|
||||
github.com/segmentio/kafka-go v0.4.38/go.mod h1:ikyuGon/60MN/vXFgykf7Zm8P5Be49gJU6vezwjnnhU=
|
||||
github.com/segmentio/kafka-go v0.4.39 h1:75smaomhvkYRwtuOwqLsdhgCG30B82NsbdkdDfFbvrw=
|
||||
github.com/segmentio/kafka-go v0.4.39/go.mod h1:T0MLgygYvmqmBvC+s8aCcbVNfJN4znVne5j0Pzowp/Q=
|
||||
github.com/silas/dag v0.0.0-20210626123444-3804bac2d6d4/go.mod h1:7RTUFBdIRC9nZ7/3RyRNH1bdqIShrDejd1YbLwgPS+I=
|
||||
github.com/silas/dag v0.0.0-20211117232152-9d50aa809f35 h1:4mohWoM/UGg1BvFFiqSPRl5uwJY3rVV0HQX0ETqauqQ=
|
||||
github.com/silas/dag v0.0.0-20211117232152-9d50aa809f35/go.mod h1:7RTUFBdIRC9nZ7/3RyRNH1bdqIShrDejd1YbLwgPS+I=
|
||||
@ -831,7 +828,6 @@ github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaO
|
||||
github.com/uber/jaeger-client-go v2.30.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
|
||||
github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg=
|
||||
github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U=
|
||||
github.com/unistack-org/micro-proto v0.0.9/go.mod h1:Cckwmzd89gvS7ThxzZp9kQR/EOdksFQcsTAtDDyKwrg=
|
||||
github.com/valyala/fastrand v1.1.0 h1:f+5HkLW4rsgzdNoleUOB69hyT9IlD2ZQh9GyDMfb5G8=
|
||||
github.com/valyala/fastrand v1.1.0/go.mod h1:HWqCzkrkg6QXT8V2EXWvXCoow7vLwOFN002oeRzjapQ=
|
||||
github.com/valyala/histogram v1.2.0 h1:wyYGAZZt3CpwUiIb9AU/Zbllg1llXyrtApRS815OLoQ=
|
||||
@ -873,20 +869,22 @@ go.unistack.org/micro-client-grpc/v3 v3.10.0 h1:RaXxV81s8cjPkZ0CLqJAJGZSpbxb0g7n
|
||||
go.unistack.org/micro-client-grpc/v3 v3.10.0/go.mod h1:BAmD+1zy0F6fih1arsW/IKp9BJKTkpp22zQfbX3M5E0=
|
||||
go.unistack.org/micro-client-http/v3 v3.9.0 h1:m2DO59EzwbWFkF3gzvUBAUoKsmH0sZ+hPrwAoDa2EvE=
|
||||
go.unistack.org/micro-client-http/v3 v3.9.0/go.mod h1:+IwOy028UpLcbRQSo+DZgGPa+CODHFAN7YGA85bdJ1M=
|
||||
go.unistack.org/micro-codec-grpc/v3 v3.8.1 h1:vZrR07L8NKziG1dtzCBKoooaHpV3oP2c7rh93ClbUGI=
|
||||
go.unistack.org/micro-codec-grpc/v3 v3.8.1/go.mod h1:RawS1ObPRsjsdvDXrGcLNnTexOHdU9yRZbF4QhWkRWw=
|
||||
go.unistack.org/micro-codec-json/v3 v3.8.0 h1:sQ6xdHaNUCxCiUakGaV1t8lbX1rGWlgnF/HbsXyhkGg=
|
||||
go.unistack.org/micro-codec-json/v3 v3.8.0/go.mod h1:+F7S3ZNTKdMsu6pYFeNdKNT8G8b/nXugdln/lUY1kO8=
|
||||
go.unistack.org/micro-codec-jsonpb/v3 v3.8.1 h1:JO5KVUC/fL0CephI42xwkKZt0SLNpP4w66nAk7O9oi8=
|
||||
go.unistack.org/micro-codec-jsonpb/v3 v3.8.1/go.mod h1:igXQT6P1wibc9mVjYS99w56s4M2DlIUCl4GQmUQrtQU=
|
||||
go.unistack.org/micro-codec-proto/v3 v3.8.1 h1:86bJca4JnE4Qp8u9sdUGyKi8n19c+3tXdDYN39KAkIY=
|
||||
go.unistack.org/micro-codec-proto/v3 v3.8.1/go.mod h1:KawLWwswDCunabwWv3QvXVJWwKNhv6WiSbR3GQ4JHHA=
|
||||
go.unistack.org/micro-codec-segmentio/v3 v3.8.1 h1:e8/8aDlTfSFM7T3azEGxUE9xQ6FPid124Uo+2p/ZCXA=
|
||||
go.unistack.org/micro-codec-segmentio/v3 v3.8.1/go.mod h1:d7xjN5JwqNXTHi9wVLZimOcKjXtZzScLbgCKeBuosPM=
|
||||
go.unistack.org/micro-codec-urlencode/v3 v3.8.1 h1:p1VzzvuQnbm2CQnn/qr7NDiuaEuM6eXuh2oExWIUFmk=
|
||||
go.unistack.org/micro-codec-urlencode/v3 v3.8.1/go.mod h1:TxaelCAvvXLyZpMIhZUvsMi6Xy2J3rvKKI7WOQhb5wI=
|
||||
go.unistack.org/micro-codec-xml/v3 v3.8.1 h1:hE211qCnyjdPt33ub1cg4HbHaKtHx0tNDXtq5xwLjQ4=
|
||||
go.unistack.org/micro-codec-xml/v3 v3.8.1/go.mod h1:sNwBgamgKsumUV06rk8Z+Gutzshfm0VnCYH+YTUCqqU=
|
||||
go.unistack.org/micro-client-mock/v3 v3.0.1 h1:wd10/8B6fioYOoGiHToHkuieLCB2O6yULTnDbUSHdQc=
|
||||
go.unistack.org/micro-client-mock/v3 v3.0.1/go.mod h1:UwTnK2oPeN7nwXNCwgwlRttCPIH2GldxkQql02eB3Fg=
|
||||
go.unistack.org/micro-codec-grpc/v3 v3.10.0 h1:N8XtNVeYBUcrQfcaY0b+PS7TaI7Wi6g5ZrEDeK77y34=
|
||||
go.unistack.org/micro-codec-grpc/v3 v3.10.0/go.mod h1:NLU7KfhAA2Es9zI5BuwFFpPW1Y20F5/9/ZX2bK0nils=
|
||||
go.unistack.org/micro-codec-json/v3 v3.10.0 h1:vSREYR9yM5R9bzCWAY9Wip+sYzLjUB2UIEJAWtpWNbg=
|
||||
go.unistack.org/micro-codec-json/v3 v3.10.0/go.mod h1:pknnB+DvzC/xi9WzkyZp5lfI0HxAo02ih2urkHpl1GQ=
|
||||
go.unistack.org/micro-codec-jsonpb/v3 v3.10.0 h1:PYe6JjYb7ngRvm04eTj9PlAxVU5+iHB4+nC3WZS3iuQ=
|
||||
go.unistack.org/micro-codec-jsonpb/v3 v3.10.0/go.mod h1:vVaYiiq8sCcCakR2NO/gahGgckxTaYvIYkEcwh6bg44=
|
||||
go.unistack.org/micro-codec-proto/v3 v3.10.0 h1:zdsMLwpZ3dbHmMt/vbgWdGAEW/rPkJaEuMPM9XuasUY=
|
||||
go.unistack.org/micro-codec-proto/v3 v3.10.0/go.mod h1:o8VeYHPK4x9UhTJqtsyB5YIi6mI2mhZMkixknWntO2Q=
|
||||
go.unistack.org/micro-codec-segmentio/v3 v3.10.0 h1:VbY31wNqk+spH6UgGB9+WmM9ZmEE9AFAuD63+99Fi1w=
|
||||
go.unistack.org/micro-codec-segmentio/v3 v3.10.0/go.mod h1:aWZowfhd+Upa5J1vsCx2naU/lC2YrQXl/UJKSL2cJKk=
|
||||
go.unistack.org/micro-codec-urlencode/v3 v3.10.0 h1:lKpZcoooAJVErl7BUV+BbmluJMKOHwEKrxlhh/v1T60=
|
||||
go.unistack.org/micro-codec-urlencode/v3 v3.10.0/go.mod h1:ySpK9glQLGoT9MHpuVqJ50AkbqOM0ti0t0Uxg9N14ys=
|
||||
go.unistack.org/micro-codec-xml/v3 v3.10.0 h1:hE48K9wGOcjWu/Fz38M0K0p9QZ+7QWBVHJq3AsysRaM=
|
||||
go.unistack.org/micro-codec-xml/v3 v3.10.0/go.mod h1:ec8JBYqOtewe+V+MemJDKcvz5hdKv92LOkmEOgQmtMI=
|
||||
go.unistack.org/micro-config-consul/v3 v3.8.2 h1:oKcyYYqLwbriy+Kv5I//I+o8QBPhPhJermciG0zvrks=
|
||||
go.unistack.org/micro-config-consul/v3 v3.8.2/go.mod h1:tnTkU8i3b0pw/KF0MiZ0nOTLSvgi3/2+ev/7+dRZUx0=
|
||||
go.unistack.org/micro-config-env/v3 v3.8.3 h1:NYuo+mHIm2uE2fZGIaP+nYi31InyTJRmD/wjEr2YsO0=
|
||||
@ -904,10 +902,10 @@ go.unistack.org/micro-proto/v3 v3.3.1 h1:nQ0MtWvP2G3QrpOgawVOPhpZZYkq6umTGDqs8Fx
|
||||
go.unistack.org/micro-proto/v3 v3.3.1/go.mod h1:cwRyv8uInM2I7EbU7O8Fx2Ls3N90Uw9UCCcq4olOdfE=
|
||||
go.unistack.org/micro-router-register/v3 v3.9.0 h1:1TFfUmKwy39zmkqp+a82WvGdpaxJF2+7DY/Gx481jbc=
|
||||
go.unistack.org/micro-router-register/v3 v3.9.0/go.mod h1:pt4a4hOJn8tniXObwDSAx1cdYR75k35FIp9fiqdWxNc=
|
||||
go.unistack.org/micro-server-grpc/v3 v3.10.1 h1:53OGnSOKSRN5SGu8oOvrbf+zh85+fLqctXIGB9jBAi0=
|
||||
go.unistack.org/micro-server-grpc/v3 v3.10.1/go.mod h1:9XEDMLU3lkBRo0GJv/xrWQPraKy7NyK0HhG4XkaJIC8=
|
||||
go.unistack.org/micro-server-http/v3 v3.10.11 h1:lLrZufToHr8kNEhcxnIy+nvyyHhHYk+QwAJ4JHixkr0=
|
||||
go.unistack.org/micro-server-http/v3 v3.10.11/go.mod h1:kvEBu/lQv1mEQ6MfiNL8RidbGSB0RZY/OYRTHSPgb9g=
|
||||
go.unistack.org/micro-server-grpc/v3 v3.10.3 h1:CElbqru8XDsurppuw9natEKNBgEHL0m/SymJYT9r+AA=
|
||||
go.unistack.org/micro-server-grpc/v3 v3.10.3/go.mod h1:n0mNurVocRBOt7iydDgORGWQ4M/wFaJFmdKHNX57IiQ=
|
||||
go.unistack.org/micro-server-http/v3 v3.10.12 h1:pJgsycMP/hC0iizP1JO1G7QskAB9/rbL3VEzWCTclfI=
|
||||
go.unistack.org/micro-server-http/v3 v3.10.12/go.mod h1:vTSaZCg+ImB6qj/3pU04NT1AxLu7j0eeF4WF85zebik=
|
||||
go.unistack.org/micro-server-tcp/v3 v3.10.0 h1:6Z4tY4Pt/bdYe7Kq/kerya3uxkZPJj/mMzOCwAegjcI=
|
||||
go.unistack.org/micro-server-tcp/v3 v3.10.0/go.mod h1:Q17E4lWRsx6dmT7eGEhV29v1DrneKgs/stKfCZkCI6o=
|
||||
go.unistack.org/micro-tracer-opentracing/v3 v3.10.1 h1:IF1kzISQuHQBKfy6mqWifBm7sbpNYccH1KM5DOyW2Hg=
|
||||
@ -916,20 +914,17 @@ go.unistack.org/micro-wrapper-recovery/v3 v3.8.3 h1:F+b+xBSupV09S9AuT5ljh8X9uMez
|
||||
go.unistack.org/micro-wrapper-recovery/v3 v3.8.3/go.mod h1:kInEBE89SfkK3doRam+oSGb6udSj/mTM4UkUQ5nAyzU=
|
||||
go.unistack.org/micro-wrapper-sql/v3 v3.10.3 h1:7JWwkCU8d5r7ew1KHvrelQ0al9XqKvljzg4MjukZjV8=
|
||||
go.unistack.org/micro-wrapper-sql/v3 v3.10.3/go.mod h1:CXyh36oCtQoIDyrPOSFmDgGDTqnEPibK585nIlbkmOM=
|
||||
go.unistack.org/micro/v3 v3.8.0/go.mod h1:Tkteri0wiiybbH6aPqay26pZHFIAwL9LXJc2x1Jkakk=
|
||||
go.unistack.org/micro/v3 v3.8.4/go.mod h1:KMMmOmbgo/D52/rCAbqeKbBsgEEbSKM69he54J3ZIuA=
|
||||
go.unistack.org/micro/v3 v3.8.5/go.mod h1:KMMmOmbgo/D52/rCAbqeKbBsgEEbSKM69he54J3ZIuA=
|
||||
go.unistack.org/micro/v3 v3.8.21/go.mod h1:aBOCQ6SkAwKMRI7Q1CIsQA2S88ibyJfweJZlT1M2qpE=
|
||||
go.unistack.org/micro/v3 v3.9.2/go.mod h1:7ssIWk+PJXvb2nSl8NUnQRs32JJEId2IDi9PobrQlKo=
|
||||
go.unistack.org/micro/v3 v3.9.13/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI=
|
||||
go.unistack.org/micro/v3 v3.9.14/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI=
|
||||
go.unistack.org/micro/v3 v3.9.18/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI=
|
||||
go.unistack.org/micro/v3 v3.10.1/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI=
|
||||
go.unistack.org/micro/v3 v3.10.4/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI=
|
||||
go.unistack.org/micro/v3 v3.10.11/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI=
|
||||
go.unistack.org/micro/v3 v3.10.12/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI=
|
||||
go.unistack.org/micro/v3 v3.10.14 h1:7fgLpwGlCN67twhwtngJDEQvrMkUBDSA5vzZqxIDqNE=
|
||||
go.unistack.org/micro/v3 v3.10.14/go.mod h1:uMAc0U/x7dmtICCrblGf0ZLgYegu3VwQAquu+OFCw1Q=
|
||||
go.unistack.org/micro/v3 v3.10.18 h1:iz193N8eZKGrKPXuX6XMsGIRHMqdvUaZSfb9mzwlUYM=
|
||||
go.unistack.org/micro/v3 v3.10.18/go.mod h1:uMAc0U/x7dmtICCrblGf0ZLgYegu3VwQAquu+OFCw1Q=
|
||||
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190506204251-e1dfcc566284/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
@ -942,8 +937,8 @@ golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5y
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20220817201139-bc19a97f63c8/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc=
|
||||
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
|
||||
golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A=
|
||||
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
|
||||
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
@ -983,8 +978,9 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8=
|
||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
@ -1044,8 +1040,9 @@ golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfS
|
||||
golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
|
||||
golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
|
||||
golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
|
||||
golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g=
|
||||
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws=
|
||||
golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
|
||||
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
@ -1085,6 +1082,7 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ
|
||||
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
@ -1149,6 +1147,7 @@ golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211110154304-99a53858aa08/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
@ -1168,12 +1167,13 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
@ -1186,8 +1186,9 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
|
||||
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68=
|
||||
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
@ -1249,8 +1250,9 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM=
|
||||
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
@ -1426,8 +1428,8 @@ google.golang.org/genproto v0.0.0-20221024153911-1573dae28c9c/go.mod h1:9qHF0xnp
|
||||
google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s=
|
||||
google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+E5bKwmfYo09AXuVN4dD894kIKUFmVbP2/Fo=
|
||||
google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg=
|
||||
google.golang.org/genproto v0.0.0-20230216225411-c8e22ba71e44 h1:EfLuoKW5WfkgVdDy7dTK8qSbH37AX5mj/MFh+bGPz14=
|
||||
google.golang.org/genproto v0.0.0-20230216225411-c8e22ba71e44/go.mod h1:8B0gmkoRebU8ukX6HP+4wrVQUY1+6PkQ44BSyIlflHA=
|
||||
google.golang.org/genproto v0.0.0-20230303212802-e74f57abe488 h1:QQF+HdiI4iocoxUjjpLgvTYDHKm99C/VtTBFnfiCJos=
|
||||
google.golang.org/genproto v0.0.0-20230303212802-e74f57abe488/go.mod h1:TvhZT5f700eVlTNwND1xoEZQeWTB2RY/65kplwl/bFA=
|
||||
google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||
@ -1466,7 +1468,7 @@ google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCD
|
||||
google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
|
||||
google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
|
||||
google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww=
|
||||
google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY=
|
||||
google.golang.org/grpc v1.52.3/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY=
|
||||
google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc=
|
||||
google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw=
|
||||
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-micro v3.10.1
|
||||
// - protoc-gen-go-micro v3.10.2
|
||||
// - protoc v3.21.12
|
||||
// source: test.proto
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// protoc-gen-go-micro version: v3.10.1
|
||||
// protoc-gen-go-micro version: v3.10.2
|
||||
// source: test.proto
|
||||
|
||||
package pb
|
||||
|
360
server/combo/combo_old_test.go
Normal file
360
server/combo/combo_old_test.go
Normal file
@ -0,0 +1,360 @@
|
||||
//go:build ignore
|
||||
|
||||
package combo_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
"net"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
// drpccli "go.unistack.org/micro-client-drpc/v3"
|
||||
grpccli "go.unistack.org/micro-client-grpc/v3"
|
||||
httpcli "go.unistack.org/micro-client-http/v3"
|
||||
jsonpbcodec "go.unistack.org/micro-codec-jsonpb/v3"
|
||||
protocodec "go.unistack.org/micro-codec-proto/v3"
|
||||
httpsrv "go.unistack.org/micro-server-http/v3"
|
||||
// mdpb "go.unistack.org/micro-tests/server/combo/mdpb"
|
||||
mgpb "go.unistack.org/micro-tests/server/combo/mgpb"
|
||||
mhpb "go.unistack.org/micro-tests/server/combo/mhpb"
|
||||
|
||||
// ndpb "go.unistack.org/micro-tests/server/combo/ndpb"
|
||||
ngpb "go.unistack.org/micro-tests/server/combo/ngpb"
|
||||
pb "go.unistack.org/micro-tests/server/combo/proto"
|
||||
"go.unistack.org/micro/v3/client"
|
||||
"go.unistack.org/micro/v3/codec"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
"go.unistack.org/micro/v3/metadata"
|
||||
"go.unistack.org/micro/v3/register"
|
||||
"go.unistack.org/micro/v3/server"
|
||||
"golang.org/x/net/http2"
|
||||
"golang.org/x/net/http2/h2c"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
"google.golang.org/grpc/encoding"
|
||||
gmetadata "google.golang.org/grpc/metadata"
|
||||
"google.golang.org/grpc/peer"
|
||||
"google.golang.org/grpc/status"
|
||||
//"storj.io/drpc"
|
||||
//"storj.io/drpc/drpcconn"
|
||||
//"storj.io/drpc/drpchttp"
|
||||
)
|
||||
|
||||
type Handler struct {
|
||||
t *testing.T
|
||||
}
|
||||
|
||||
const (
|
||||
grpcDefaultContentType = "application/grpc+proto"
|
||||
// drpcDefaultContentType = "application/drpc+proto"
|
||||
httpDefaultContentType = "application/json"
|
||||
)
|
||||
|
||||
type wrapMicroCodec struct{ codec.Codec }
|
||||
|
||||
func (w *wrapMicroCodec) Name() string {
|
||||
return w.Codec.String()
|
||||
}
|
||||
|
||||
func (w *wrapMicroCodec) Marshal(v interface{}) ([]byte, error) {
|
||||
return w.Codec.Marshal(v)
|
||||
}
|
||||
|
||||
func (w *wrapMicroCodec) Unmarshal(d []byte, v interface{}) error {
|
||||
return w.Codec.Unmarshal(d, v)
|
||||
}
|
||||
|
||||
func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
// ctx := r.Context()
|
||||
w.Header().Add("Content-Type", httpDefaultContentType)
|
||||
w.WriteHeader(http.StatusOK)
|
||||
_ = jsonpbcodec.NewCodec().Write(w, nil, &pb.CallRsp{Rsp: "name_my_name"})
|
||||
}
|
||||
|
||||
func (h *Handler) ServeGRPC(_ interface{}, stream grpc.ServerStream) error {
|
||||
ctx := stream.Context()
|
||||
|
||||
fullMethod, ok := grpc.MethodFromServerStream(stream)
|
||||
if !ok {
|
||||
return status.Errorf(codes.Internal, "method does not exist in context")
|
||||
}
|
||||
|
||||
serviceName, methodName, err := grpcServiceMethod(fullMethod)
|
||||
if err != nil {
|
||||
return status.New(codes.InvalidArgument, err.Error()).Err()
|
||||
}
|
||||
_, _ = serviceName, methodName
|
||||
// get grpc metadata
|
||||
gmd, ok := gmetadata.FromIncomingContext(stream.Context())
|
||||
if !ok {
|
||||
gmd = gmetadata.MD{}
|
||||
}
|
||||
|
||||
md := metadata.New(len(gmd))
|
||||
for k, v := range gmd {
|
||||
md.Set(k, strings.Join(v, ", "))
|
||||
}
|
||||
|
||||
// timeout for server deadline
|
||||
to, ok := md.Get("timeout")
|
||||
if ok {
|
||||
md.Del("timeout")
|
||||
}
|
||||
|
||||
// get content type
|
||||
ct := grpcDefaultContentType
|
||||
|
||||
if ctype, ok := md.Get("content-type"); ok {
|
||||
ct = ctype
|
||||
} else if ctype, ok := md.Get("x-content-type"); ok {
|
||||
ct = ctype
|
||||
md.Del("x-content-type")
|
||||
}
|
||||
|
||||
_ = ct
|
||||
|
||||
// get peer from context
|
||||
if p, ok := peer.FromContext(ctx); ok {
|
||||
md["Remote"] = p.Addr.String()
|
||||
ctx = peer.NewContext(ctx, p)
|
||||
}
|
||||
|
||||
// create new context
|
||||
ctx = metadata.NewIncomingContext(ctx, md)
|
||||
|
||||
// set the timeout if we have it
|
||||
if len(to) > 0 {
|
||||
if n, err := strconv.ParseUint(to, 10, 64); err == nil {
|
||||
var cancel context.CancelFunc
|
||||
ctx, cancel = context.WithTimeout(ctx, time.Duration(n))
|
||||
defer cancel()
|
||||
}
|
||||
}
|
||||
|
||||
frame := &codec.Frame{}
|
||||
if err := stream.RecvMsg(frame); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// logger.Infof(ctx, "frame: %s", frame.Data)
|
||||
|
||||
if err := stream.SendMsg(&pb.CallRsp{Rsp: "name_my_name"}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func grpcServiceMethod(m string) (string, string, error) {
|
||||
if len(m) == 0 {
|
||||
return "", "", fmt.Errorf("malformed method name: %q", m)
|
||||
}
|
||||
|
||||
// grpc method
|
||||
if m[0] == '/' {
|
||||
// [ , Foo, Bar]
|
||||
// [ , package.Foo, Bar]
|
||||
// [ , a.package.Foo, Bar]
|
||||
parts := strings.Split(m, "/")
|
||||
if len(parts) != 3 || len(parts[1]) == 0 || len(parts[2]) == 0 {
|
||||
return "", "", fmt.Errorf("malformed method name: %q", m)
|
||||
}
|
||||
service := strings.Split(parts[1], ".")
|
||||
return service[len(service)-1], parts[2], nil
|
||||
}
|
||||
|
||||
// non grpc method
|
||||
parts := strings.Split(m, ".")
|
||||
|
||||
// expect [Foo, Bar]
|
||||
if len(parts) != 2 {
|
||||
return "", "", fmt.Errorf("malformed method name: %q", m)
|
||||
}
|
||||
|
||||
return parts[0], parts[1], nil
|
||||
}
|
||||
|
||||
/*
|
||||
func (h *Handler) ServeDRPC(stream drpc.Stream, rpc string) error {
|
||||
ctx := stream.Context()
|
||||
logger.Infof(ctx, "drpc: %#+v", rpc)
|
||||
return nil
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
func (h *Handler) HandleRPC(stream drpc.Stream, rpc string) error {
|
||||
return h.ServeDRPC(stream, rpc)
|
||||
}
|
||||
*/
|
||||
|
||||
func TestComboServer(t *testing.T) {
|
||||
reg := register.NewRegister()
|
||||
ctx := context.Background()
|
||||
|
||||
h := &Handler{t: t}
|
||||
|
||||
_ = logger.DefaultLogger.Init(logger.WithCallerSkipCount(3))
|
||||
encoding.RegisterCodec(&wrapMicroCodec{protocodec.NewCodec()})
|
||||
|
||||
lis, err := net.Listen("tcp", fmt.Sprintf(":0"))
|
||||
if err != nil {
|
||||
t.Fatalf("failed to listen: %v", err)
|
||||
}
|
||||
|
||||
gsrv := grpc.NewServer(grpc.UnknownServiceHandler(h.ServeGRPC))
|
||||
go func() {
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return
|
||||
default:
|
||||
if err := gsrv.Serve(lis); err != nil {
|
||||
log.Fatalf("failed to serve: %v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
comboHandler := newComboMux(h, gsrv, nil) // drpchttp.New(h))
|
||||
http2Server := &http2.Server{}
|
||||
hs := &http.Server{Handler: h2c.NewHandler(comboHandler, http2Server)}
|
||||
|
||||
// create server
|
||||
srv := httpsrv.NewServer(
|
||||
server.Address("127.0.0.1:0"),
|
||||
server.Name("helloworld"),
|
||||
server.Register(reg),
|
||||
httpsrv.Server(hs),
|
||||
)
|
||||
|
||||
// init server
|
||||
if err := srv.Init(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// start server
|
||||
if err := srv.Start(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// lookup server
|
||||
service, err := reg.LookupService(ctx, "helloworld")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if len(service) != 1 {
|
||||
t.Fatalf("Expected 1 service got %d: %+v", len(service), service)
|
||||
}
|
||||
|
||||
if len(service[0].Nodes) != 1 {
|
||||
t.Fatalf("Expected 1 node got %d: %+v", len(service[0].Nodes), service[0].Nodes)
|
||||
}
|
||||
|
||||
mhcli := client.NewClientCallOptions(httpcli.NewClient(client.ContentType(httpDefaultContentType), client.Codec(httpDefaultContentType, jsonpbcodec.NewCodec())), client.WithAddress("http://"+service[0].Nodes[0].Address))
|
||||
|
||||
mhttpsvc := mhpb.NewTestClient("helloworld", mhcli)
|
||||
|
||||
mgcli := client.NewClientCallOptions(grpccli.NewClient(client.ContentType(grpcDefaultContentType), client.Codec(grpcDefaultContentType, protocodec.NewCodec())), client.WithAddress("http://"+service[0].Nodes[0].Address))
|
||||
|
||||
mgrpcsvc := mgpb.NewTestClient("helloworld", mgcli)
|
||||
|
||||
// mdcli := client.NewClientCallOptions(drpccli.NewClient(client.ContentType(drpcDefaultContentType), client.Codec(drpcDefaultContentType, protocodec.NewCodec())), client.WithAddress("http://"+service[0].Nodes[0].Address))
|
||||
|
||||
// mdrpcsvc := mdpb.NewTestClient("helloworld", mdcli)
|
||||
|
||||
t.Logf("call via micro grpc")
|
||||
rsp, err := mgrpcsvc.Call(ctx, &pb.CallReq{Req: "my_name"})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
} else {
|
||||
if rsp.Rsp != "name_my_name" {
|
||||
t.Fatalf("invalid response: %#+v\n", rsp)
|
||||
}
|
||||
}
|
||||
|
||||
ngcli, err := grpc.DialContext(ctx, service[0].Nodes[0].Address, grpc.WithTransportCredentials(insecure.NewCredentials()))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer ngcli.Close()
|
||||
|
||||
ngrpcsvc := ngpb.NewTestClient(ngcli)
|
||||
t.Logf("call via native grpc")
|
||||
if rsp, err := ngrpcsvc.Call(ctx, &ngpb.CallReq{Req: "my_name"}); err != nil {
|
||||
t.Fatal(err)
|
||||
} else {
|
||||
if rsp.Rsp != "name_my_name" {
|
||||
t.Fatalf("invalid response: %#+v\n", rsp)
|
||||
}
|
||||
}
|
||||
|
||||
t.Logf("call via micro http")
|
||||
if rsp, err := mhttpsvc.Call(ctx, &pb.CallReq{Req: "my_name"}); err != nil {
|
||||
t.Fatal(err)
|
||||
} else {
|
||||
if rsp.Rsp != "name_my_name" {
|
||||
t.Fatalf("invalid response: %#+v\n", rsp)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
tc, err := net.Dial("tcp", service[0].Nodes[0].Address)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
ndcli := drpcconn.New(tc)
|
||||
defer ndcli.Close()
|
||||
/*
|
||||
ndrpcsvc := ndpb.NewDRPCTestClient(ndcli)
|
||||
|
||||
t.Logf("call via native drpc")
|
||||
if rsp, err := ndrpcsvc.Call(context.TODO(), &ndpb.CallReq{Req: "my_name"}); err != nil {
|
||||
t.Logf("native drpc err: %v", err)
|
||||
// t.Fatal(err)
|
||||
} else {
|
||||
if rsp.Rsp != "name_my_name" {
|
||||
t.Fatalf("invalid response: %#+v\n", rsp)
|
||||
}
|
||||
}
|
||||
|
||||
t.Logf("call via micro drpc")
|
||||
if rsp, err = mdrpcsvc.Call(ctx, &pb.CallReq{Req: "my_name"}); err != nil {
|
||||
t.Logf("micro drpc err: %v", err)
|
||||
// t.Fatal(err)
|
||||
} else {
|
||||
if rsp.Rsp != "name_my_name" {
|
||||
t.Fatalf("invalid response: %#+v\n", rsp)
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
func newComboMux(httph http.Handler, grpch http.Handler, drpch http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if r.ProtoMajor == 2 {
|
||||
ct := r.Header.Get("content-type")
|
||||
switch {
|
||||
case strings.HasPrefix(ct, "application/grpc"):
|
||||
if grpch != nil {
|
||||
grpch.ServeHTTP(w, r)
|
||||
}
|
||||
return
|
||||
case strings.HasPrefix(ct, "application/drpc"):
|
||||
if drpch != nil {
|
||||
drpch.ServeHTTP(w, r)
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
httph.ServeHTTP(w, r)
|
||||
})
|
||||
}
|
@ -1,199 +1,74 @@
|
||||
package combo_test
|
||||
|
||||
/*
|
||||
import (
|
||||
"context"
|
||||
"embed"
|
||||
"fmt"
|
||||
"log"
|
||||
"net"
|
||||
"io"
|
||||
"io/fs"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
drpccli "go.unistack.org/micro-client-drpc/v3"
|
||||
grpccli "go.unistack.org/micro-client-grpc/v3"
|
||||
httpcli "go.unistack.org/micro-client-http/v3"
|
||||
jsonpbcodec "go.unistack.org/micro-codec-jsonpb/v3"
|
||||
protocodec "go.unistack.org/micro-codec-proto/v3"
|
||||
grpcsrv "go.unistack.org/micro-server-grpc/v3"
|
||||
httpsrv "go.unistack.org/micro-server-http/v3"
|
||||
mdpb "go.unistack.org/micro-tests/server/combo/mdpb"
|
||||
mgpb "go.unistack.org/micro-tests/server/combo/mgpb"
|
||||
mhpb "go.unistack.org/micro-tests/server/combo/mhpb"
|
||||
|
||||
// ndpb "go.unistack.org/micro-tests/server/combo/ndpb"
|
||||
// ngpb "go.unistack.org/micro-tests/server/combo/ngpb"
|
||||
ngpb "go.unistack.org/micro-tests/server/combo/ngpb"
|
||||
pb "go.unistack.org/micro-tests/server/combo/proto"
|
||||
"go.unistack.org/micro/v3/client"
|
||||
"go.unistack.org/micro/v3/codec"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
"go.unistack.org/micro/v3/metadata"
|
||||
"go.unistack.org/micro/v3/register"
|
||||
"go.unistack.org/micro/v3/server"
|
||||
"golang.org/x/net/http2"
|
||||
"golang.org/x/net/http2/h2c"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
"google.golang.org/grpc/encoding"
|
||||
gmetadata "google.golang.org/grpc/metadata"
|
||||
"google.golang.org/grpc/peer"
|
||||
"google.golang.org/grpc/status"
|
||||
"storj.io/drpc"
|
||||
"storj.io/drpc/drpcconn"
|
||||
"storj.io/drpc/drpchttp"
|
||||
)
|
||||
|
||||
//go:embed swagger-ui
|
||||
var assets embed.FS
|
||||
|
||||
type Handler struct {
|
||||
t *testing.T
|
||||
}
|
||||
|
||||
const (
|
||||
grpcDefaultContentType = "application/grpc+proto"
|
||||
drpcDefaultContentType = "application/drpc+proto"
|
||||
httpDefaultContentType = "application/json"
|
||||
)
|
||||
|
||||
type wrapMicroCodec struct{ codec.Codec }
|
||||
|
||||
func (w *wrapMicroCodec) Name() string {
|
||||
return w.Codec.String()
|
||||
}
|
||||
|
||||
func (w *wrapMicroCodec) Marshal(v interface{}) ([]byte, error) {
|
||||
return w.Codec.Marshal(v)
|
||||
}
|
||||
|
||||
func (w *wrapMicroCodec) Unmarshal(d []byte, v interface{}) error {
|
||||
return w.Codec.Unmarshal(d, v)
|
||||
}
|
||||
|
||||
func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
// ctx := r.Context()
|
||||
w.Header().Add("Content-Type", httpDefaultContentType)
|
||||
w.WriteHeader(http.StatusOK)
|
||||
_ = jsonpbcodec.NewCodec().Write(w, nil, &pb.CallRsp{Rsp: "name_my_name"})
|
||||
}
|
||||
|
||||
func (h *Handler) ServeGRPC(_ interface{}, stream grpc.ServerStream) error {
|
||||
ctx := stream.Context()
|
||||
|
||||
fullMethod, ok := grpc.MethodFromServerStream(stream)
|
||||
if !ok {
|
||||
return status.Errorf(codes.Internal, "method does not exist in context")
|
||||
}
|
||||
|
||||
serviceName, methodName, err := grpcServiceMethod(fullMethod)
|
||||
if err != nil {
|
||||
return status.New(codes.InvalidArgument, err.Error()).Err()
|
||||
}
|
||||
_, _ = serviceName, methodName
|
||||
// get grpc metadata
|
||||
gmd, ok := gmetadata.FromIncomingContext(stream.Context())
|
||||
if !ok {
|
||||
gmd = gmetadata.MD{}
|
||||
}
|
||||
|
||||
md := metadata.New(len(gmd))
|
||||
for k, v := range gmd {
|
||||
md.Set(k, strings.Join(v, ", "))
|
||||
}
|
||||
|
||||
// timeout for server deadline
|
||||
to, ok := md.Get("timeout")
|
||||
if ok {
|
||||
md.Del("timeout")
|
||||
}
|
||||
|
||||
// get content type
|
||||
ct := grpcDefaultContentType
|
||||
|
||||
if ctype, ok := md.Get("content-type"); ok {
|
||||
ct = ctype
|
||||
} else if ctype, ok := md.Get("x-content-type"); ok {
|
||||
ct = ctype
|
||||
md.Del("x-content-type")
|
||||
}
|
||||
|
||||
_ = ct
|
||||
|
||||
// get peer from context
|
||||
if p, ok := peer.FromContext(ctx); ok {
|
||||
md["Remote"] = p.Addr.String()
|
||||
ctx = peer.NewContext(ctx, p)
|
||||
}
|
||||
|
||||
// create new context
|
||||
ctx = metadata.NewIncomingContext(ctx, md)
|
||||
|
||||
// set the timeout if we have it
|
||||
if len(to) > 0 {
|
||||
if n, err := strconv.ParseUint(to, 10, 64); err == nil {
|
||||
var cancel context.CancelFunc
|
||||
ctx, cancel = context.WithTimeout(ctx, time.Duration(n))
|
||||
defer cancel()
|
||||
func newComboMux(httph http.Handler, grpch http.Handler, drpch http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if r.ProtoMajor == 2 {
|
||||
ct := r.Header.Get("content-type")
|
||||
switch {
|
||||
case strings.HasPrefix(ct, "application/grpc"):
|
||||
if grpch != nil {
|
||||
grpch.ServeHTTP(w, r)
|
||||
}
|
||||
return
|
||||
case strings.HasPrefix(ct, "application/drpc"):
|
||||
if drpch != nil {
|
||||
drpch.ServeHTTP(w, r)
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
frame := &codec.Frame{}
|
||||
if err := stream.RecvMsg(frame); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// logger.Infof(ctx, "frame: %s", frame.Data)
|
||||
|
||||
if err := stream.SendMsg(&pb.CallRsp{Rsp: "name_my_name"}); err != nil {
|
||||
return err
|
||||
}
|
||||
httph.ServeHTTP(w, r)
|
||||
})
|
||||
}
|
||||
|
||||
func (h *Handler) Call(ctx context.Context, req *pb.CallReq, rsp *pb.CallRsp) error {
|
||||
rsp.Rsp = "name_my_name"
|
||||
return nil
|
||||
}
|
||||
|
||||
func grpcServiceMethod(m string) (string, string, error) {
|
||||
if len(m) == 0 {
|
||||
return "", "", fmt.Errorf("malformed method name: %q", m)
|
||||
}
|
||||
|
||||
// grpc method
|
||||
if m[0] == '/' {
|
||||
// [ , Foo, Bar]
|
||||
// [ , package.Foo, Bar]
|
||||
// [ , a.package.Foo, Bar]
|
||||
parts := strings.Split(m, "/")
|
||||
if len(parts) != 3 || len(parts[1]) == 0 || len(parts[2]) == 0 {
|
||||
return "", "", fmt.Errorf("malformed method name: %q", m)
|
||||
}
|
||||
service := strings.Split(parts[1], ".")
|
||||
return service[len(service)-1], parts[2], nil
|
||||
}
|
||||
|
||||
// non grpc method
|
||||
parts := strings.Split(m, ".")
|
||||
|
||||
// expect [Foo, Bar]
|
||||
if len(parts) != 2 {
|
||||
return "", "", fmt.Errorf("malformed method name: %q", m)
|
||||
}
|
||||
|
||||
return parts[0], parts[1], nil
|
||||
}
|
||||
|
||||
func (h *Handler) ServeDRPC(stream drpc.Stream, rpc string) error {
|
||||
ctx := stream.Context()
|
||||
logger.Infof(ctx, "drpc: %#+v", rpc)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (h *Handler) ServeWS(w http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
logger.Infof(ctx, "ws: %#+v", r)
|
||||
}
|
||||
|
||||
func (h *Handler) HandleRPC(stream drpc.Stream, rpc string) error {
|
||||
return h.ServeDRPC(stream, rpc)
|
||||
}
|
||||
|
||||
func TestComboServer(t *testing.T) {
|
||||
reg := register.NewRegister()
|
||||
ctx := context.Background()
|
||||
@ -201,29 +76,51 @@ func TestComboServer(t *testing.T) {
|
||||
h := &Handler{t: t}
|
||||
|
||||
_ = logger.DefaultLogger.Init(logger.WithCallerSkipCount(3))
|
||||
encoding.RegisterCodec(&wrapMicroCodec{protocodec.NewCodec()})
|
||||
|
||||
gsrv := grpc.NewServer(grpc.UnknownServiceHandler(h.ServeGRPC))
|
||||
// create grpc server
|
||||
gsrv := grpcsrv.NewServer(
|
||||
server.Name("helloworld"),
|
||||
server.Register(reg),
|
||||
server.Codec("application/json", jsonpbcodec.NewCodec()),
|
||||
server.Codec("application/grpc", protocodec.NewCodec()),
|
||||
server.Codec("application/grpc+proto", protocodec.NewCodec()),
|
||||
server.Codec("application/grpc+json", jsonpbcodec.NewCodec()),
|
||||
)
|
||||
|
||||
comboHandler := newComboMux(h, gsrv, drpchttp.New(h))
|
||||
http2Server := &http2.Server{}
|
||||
hs := &http.Server{Handler: h2c.NewHandler(comboHandler, http2Server)}
|
||||
// init grpc server
|
||||
if err := gsrv.Init(); err != nil {
|
||||
t.Fatalf("grpc err: %v", err)
|
||||
}
|
||||
|
||||
// create server
|
||||
srv := httpsrv.NewServer(
|
||||
if err := mgpb.RegisterTestServer(gsrv, h); err != nil {
|
||||
t.Fatalf("grpc err: %v", err)
|
||||
}
|
||||
|
||||
swaggerdir, _ := fs.Sub(assets, "swagger-ui")
|
||||
|
||||
// create http server
|
||||
hsrv := httpsrv.NewServer(
|
||||
server.Address("127.0.0.1:0"),
|
||||
server.Name("helloworld"),
|
||||
server.Register(reg),
|
||||
httpsrv.Server(hs),
|
||||
server.Codec("application/json", jsonpbcodec.NewCodec()),
|
||||
httpsrv.PathHandler(http.MethodGet, "/swagger-ui/*", http.StripPrefix("/swagger-ui", http.FileServer(http.FS(swaggerdir))).ServeHTTP),
|
||||
)
|
||||
|
||||
// init server
|
||||
if err := srv.Init(); err != nil {
|
||||
// fill http server handler struct
|
||||
hs := &http.Server{Handler: h2c.NewHandler(newComboMux(hsrv, gsrv.GRPCServer(), nil), &http2.Server{})}
|
||||
|
||||
// init http server
|
||||
if err := hsrv.Init(httpsrv.Server(hs)); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// start server
|
||||
if err := srv.Start(); err != nil {
|
||||
if err := mhpb.RegisterTestServer(hsrv, h); err != nil {
|
||||
t.Fatalf("grpc err: %v", err)
|
||||
}
|
||||
|
||||
// start http server
|
||||
if err := hsrv.Start(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@ -249,29 +146,11 @@ func TestComboServer(t *testing.T) {
|
||||
|
||||
mgrpcsvc := mgpb.NewTestClient("helloworld", mgcli)
|
||||
|
||||
mdcli := client.NewClientCallOptions(drpccli.NewClient(client.ContentType(drpcDefaultContentType), client.Codec(drpcDefaultContentType, protocodec.NewCodec())), client.WithAddress("http://"+service[0].Nodes[0].Address))
|
||||
|
||||
mdrpcsvc := mdpb.NewTestClient("helloworld", mdcli)
|
||||
|
||||
t.Logf("call via micro grpc")
|
||||
rsp, err := mgrpcsvc.Call(ctx, &pb.CallReq{Req: "my_name"})
|
||||
if err != nil {
|
||||
if rsp, err := mgrpcsvc.Call(ctx, &pb.CallReq{Req: "my_name"}); err != nil {
|
||||
t.Fatal(err)
|
||||
} else {
|
||||
if rsp.Rsp != "name_my_name" {
|
||||
t.Fatalf("invalid response: %#+v\n", rsp)
|
||||
}
|
||||
}
|
||||
|
||||
lis, err := net.Listen("tcp", fmt.Sprintf(":0"))
|
||||
if err != nil {
|
||||
t.Fatalf("failed to listen: %v", err)
|
||||
}
|
||||
s := grpc.NewServer()
|
||||
pb.RegisterGreeterServer(s, &server{})
|
||||
log.Printf("server listening at %v", lis.Addr())
|
||||
if err := s.Serve(lis); err != nil {
|
||||
log.Fatalf("failed to serve: %v", err)
|
||||
} else if rsp.Rsp != "name_my_name" {
|
||||
t.Fatalf("invalid response: %#+v\n", rsp)
|
||||
}
|
||||
|
||||
ngcli, err := grpc.DialContext(ctx, service[0].Nodes[0].Address, grpc.WithTransportCredentials(insecure.NewCredentials()))
|
||||
@ -280,83 +159,51 @@ func TestComboServer(t *testing.T) {
|
||||
}
|
||||
defer ngcli.Close()
|
||||
|
||||
/*
|
||||
ngrpcsvc := ngpb.NewTestClient(ngcli)
|
||||
t.Logf("call via native grpc")
|
||||
if rsp, err := ngrpcsvc.Call(ctx, &ngpb.CallReq{Req: "my_name"}); err != nil {
|
||||
t.Fatal(err)
|
||||
} else {
|
||||
if rsp.Rsp != "name_my_name" {
|
||||
t.Fatalf("invalid response: %#+v\n", rsp)
|
||||
}
|
||||
}
|
||||
|
||||
ngrpcsvc := ngpb.NewTestClient(ngcli)
|
||||
t.Logf("call via native grpc")
|
||||
if rsp, err := ngrpcsvc.Call(ctx, &ngpb.CallReq{Req: "my_name"}); err != nil {
|
||||
t.Fatal(err)
|
||||
} else if rsp.Rsp != "name_my_name" {
|
||||
t.Fatalf("invalid response: %#+v\n", rsp)
|
||||
}
|
||||
|
||||
t.Logf("call via micro http")
|
||||
if rsp, err := mhttpsvc.Call(ctx, &pb.CallReq{Req: "my_name"}); err != nil {
|
||||
t.Fatal(err)
|
||||
} else {
|
||||
if rsp.Rsp != "name_my_name" {
|
||||
t.Fatalf("invalid response: %#+v\n", rsp)
|
||||
}
|
||||
} else if rsp.Rsp != "name_my_name" {
|
||||
t.Fatalf("invalid response: %#+v\n", rsp)
|
||||
}
|
||||
|
||||
tc, err := net.Dial("tcp", service[0].Nodes[0].Address)
|
||||
var hreq *http.Request
|
||||
hreq, err = http.NewRequestWithContext(ctx, http.MethodGet, fmt.Sprintf("http://%s/swagger-ui/index.html", service[0].Nodes[0].Address), nil)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
var hrsp *http.Response
|
||||
hrsp, err = http.DefaultClient.Do(hreq)
|
||||
if err != nil || hrsp.StatusCode != http.StatusOK {
|
||||
t.Fatalf("error rsp: %v err: %v", hrsp, err)
|
||||
}
|
||||
|
||||
ndcli := drpcconn.New(tc)
|
||||
defer ndcli.Close()
|
||||
/*
|
||||
ndrpcsvc := ndpb.NewDRPCTestClient(ndcli)
|
||||
hreq, err = http.NewRequestWithContext(ctx, http.MethodPost, fmt.Sprintf("http://%s/Call", service[0].Nodes[0].Address), strings.NewReader(`{"req":"my_name"}`))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
hreq.Header.Add("Content-Type", "application/json")
|
||||
|
||||
t.Logf("call via native drpc")
|
||||
if rsp, err := ndrpcsvc.Call(context.TODO(), &ndpb.CallReq{Req: "my_name"}); err != nil {
|
||||
t.Logf("native drpc err: %v", err)
|
||||
// t.Fatal(err)
|
||||
} else {
|
||||
if rsp.Rsp != "name_my_name" {
|
||||
t.Fatalf("invalid response: %#+v\n", rsp)
|
||||
}
|
||||
}
|
||||
|
||||
t.Logf("call via micro drpc")
|
||||
if rsp, err = mdrpcsvc.Call(ctx, &pb.CallReq{Req: "my_name"}); err != nil {
|
||||
t.Logf("micro drpc err: %v", err)
|
||||
// t.Fatal(err)
|
||||
} else {
|
||||
if rsp.Rsp != "name_my_name" {
|
||||
t.Fatalf("invalid response: %#+v\n", rsp)
|
||||
}
|
||||
hrsp, err = http.DefaultClient.Do(hreq)
|
||||
if err != nil || hrsp.StatusCode != http.StatusOK {
|
||||
t.Fatalf("error rsp: %v err: %v", hrsp, err)
|
||||
}
|
||||
defer hrsp.Body.Close()
|
||||
buf, err := io.ReadAll(hrsp.Body)
|
||||
if err != nil {
|
||||
t.Fatalf("read body fail: %v", err)
|
||||
}
|
||||
rsp := &pb.CallRsp{}
|
||||
if err = jsonpbcodec.NewCodec().Unmarshal(buf, rsp); err != nil {
|
||||
t.Fatal(err)
|
||||
} else if rsp.Rsp != "name_my_name" {
|
||||
t.Fatalf("invalid response: %#+v\n", rsp)
|
||||
}
|
||||
}
|
||||
|
||||
func newComboMux(httph http.Handler, grpch http.Handler, drpch http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if r.ProtoMajor == 2 {
|
||||
ct := r.Header.Get("content-type")
|
||||
switch {
|
||||
case strings.HasPrefix(ct, "application/grpc"):
|
||||
grpch.ServeHTTP(w, r)
|
||||
return
|
||||
case strings.HasPrefix(ct, "application/drpc"):
|
||||
drpch.ServeHTTP(w, r)
|
||||
return
|
||||
}
|
||||
}
|
||||
ws := false
|
||||
for _, header := range r.Header["Upgrade"] {
|
||||
if header == "websocket" {
|
||||
ws = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if ws {
|
||||
httph.(*Handler).ServeWS(w, r)
|
||||
return
|
||||
}
|
||||
httph.ServeHTTP(w, r)
|
||||
})
|
||||
}
|
||||
*/
|
||||
|
@ -1,15 +1,21 @@
|
||||
package combo
|
||||
|
||||
//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 go.unistack.org/micro-proto/v3) --go_out=paths=source_relative:./proto proto/proto.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',standalone=true,debug=true,paths=source_relative:./mhpb 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|grpc',standalone=true,debug=true,paths=source_relative:./mgpb proto/proto.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|grpc',standalone=true,debug=true,paths=source_relative:./mgpb 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',standalone=true,debug=true,paths=source_relative:./mhpb proto/proto.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|drpc',standalone=true,debug=true,paths=source_relative:./mdpb 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='openapiv3',openapi_file=./apidocs.swagger.yaml,standalone=true,debug=true,paths=source_relative:./proto proto/proto.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:./ngpb proto/test.proto"
|
||||
//go:generate sh -c "protoc -I./proto -I. -I$(go list -f '{{ .Dir }}' -m go.unistack.org/micro-proto/v3) --go-grpc_out=paths=source_relative:./ngpb proto/test.proto"
|
||||
//go:generate sh -c "protoc -I./ngpb -I. -I$(go list -f '{{ .Dir }}' -m go.unistack.org/micro-proto/v3) --go_out=paths=source_relative:./ngpb ngpb/ngpb.proto"
|
||||
//go:generate sh -c "protoc -I./ngpb -I. -I$(go list -f '{{ .Dir }}' -m go.unistack.org/micro-proto/v3) --go-grpc_out=paths=source_relative:./ngpb ngpb/ngpb.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:./ndpb proto/test.proto"
|
||||
//go:generate sh -c "protoc -I./proto -I. -I$(go list -f '{{ .Dir }}' -m go.unistack.org/micro-proto/v3) --go-drpc_out=json=false,paths=source_relative:./ndpb 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:./ndpb proto/proto.proto"
|
||||
////go:generate sh -c "protoc -I./proto -I. -I$(go list -f '{{ .Dir }}' -m go.unistack.org/micro-proto/v3) --go-drpc_out=json=false,paths=source_relative:./ndpb proto/proto.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',standalone=true,debug=true,paths=source_relative:./mhpb proto/proto.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|drpc',standalone=true,debug=true,paths=source_relative:./mdpb proto/proto.proto"
|
||||
|
||||
//go:generate sh -c "mkdir -p swagger-ui && cp proto/apidocs.swagger.yaml swagger-ui/swagger.yaml && curl -L https://github.com/swagger-api/swagger-ui/archive/refs/tags/v4.17.0.tar.gz -o v4.17.0.tar.gz && tar -C swagger-ui --strip-components=2 -zxvf v4.17.0.tar.gz swagger-ui-4.17.0/dist && rm -f v4.17.0.tar.gz && sed -i '' 's|https://petstore.swagger.io/v2/swagger.json|./swagger.yaml|g' swagger-ui/index.html swagger-ui/swagger-initializer.js && sed -i '' 's|deepLinking: true,|deepLinking: true, displayOperationId: true, tryItOutEnabled: true,|g' swagger-ui/swagger-initializer.js "
|
||||
|
@ -1,59 +0,0 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// protoc-gen-go-micro version: v3.10.1
|
||||
// source: test.proto
|
||||
|
||||
package pb
|
||||
|
||||
import (
|
||||
context "context"
|
||||
v3 "go.unistack.org/micro-server-http/v3"
|
||||
proto "go.unistack.org/micro-tests/server/combo/proto"
|
||||
client "go.unistack.org/micro/v3/client"
|
||||
server "go.unistack.org/micro/v3/server"
|
||||
time "time"
|
||||
)
|
||||
|
||||
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.CallReq, opts ...client.CallOption) (*proto.CallRsp, error) {
|
||||
td := time.Duration(5000000000)
|
||||
opts = append(opts, client.WithRequestTimeout(td))
|
||||
rsp := &proto.CallRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "test.v1.Test.Call", req), rsp, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rsp, nil
|
||||
}
|
||||
|
||||
type testServer struct {
|
||||
TestServer
|
||||
}
|
||||
|
||||
func (h *testServer) Call(ctx context.Context, req *proto.CallReq, rsp *proto.CallRsp) error {
|
||||
var cancel context.CancelFunc
|
||||
td := time.Duration(5000000000)
|
||||
ctx, cancel = context.WithTimeout(ctx, td)
|
||||
defer cancel()
|
||||
return h.TestServer.Call(ctx, req, rsp)
|
||||
}
|
||||
|
||||
func RegisterTestServer(s server.Server, sh TestServer, opts ...server.HandlerOption) error {
|
||||
type test interface {
|
||||
Call(ctx context.Context, req *proto.CallReq, rsp *proto.CallRsp) error
|
||||
}
|
||||
type Test struct {
|
||||
test
|
||||
}
|
||||
h := &testServer{sh}
|
||||
var nopts []server.HandlerOption
|
||||
nopts = append(nopts, v3.HandlerEndpoints(TestServerEndpoints))
|
||||
return s.Handle(s.NewHandler(&Test{h}, append(nopts, opts...)...))
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-micro v3.10.1
|
||||
// - protoc-gen-go-micro v3.10.2
|
||||
// - protoc v3.21.12
|
||||
// source: test.proto
|
||||
// source: proto.proto
|
||||
|
||||
package pb
|
||||
|
||||
@ -20,7 +20,7 @@ var (
|
||||
TestServerEndpoints = []v3.EndpointMetadata{
|
||||
{
|
||||
Name: "Test.Call",
|
||||
Path: "/v1/call",
|
||||
Path: "/Call",
|
||||
Method: "POST",
|
||||
Body: "*",
|
||||
Stream: false,
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// protoc-gen-go-micro version: v3.10.1
|
||||
// source: test.proto
|
||||
// protoc-gen-go-micro version: v3.10.2
|
||||
// source: proto.proto
|
||||
|
||||
package pb
|
||||
|
||||
@ -10,7 +10,6 @@ import (
|
||||
proto "go.unistack.org/micro-tests/server/combo/proto"
|
||||
client "go.unistack.org/micro/v3/client"
|
||||
server "go.unistack.org/micro/v3/server"
|
||||
time "time"
|
||||
)
|
||||
|
||||
type testClient struct {
|
||||
@ -23,8 +22,6 @@ func NewTestClient(name string, c client.Client) TestClient {
|
||||
}
|
||||
|
||||
func (c *testClient) Call(ctx context.Context, req *proto.CallReq, opts ...client.CallOption) (*proto.CallRsp, error) {
|
||||
td := time.Duration(5000000000)
|
||||
opts = append(opts, client.WithRequestTimeout(td))
|
||||
rsp := &proto.CallRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "Test.Call", req), rsp, opts...)
|
||||
if err != nil {
|
||||
@ -38,10 +35,6 @@ type testServer struct {
|
||||
}
|
||||
|
||||
func (h *testServer) Call(ctx context.Context, req *proto.CallReq, rsp *proto.CallRsp) error {
|
||||
var cancel context.CancelFunc
|
||||
td := time.Duration(5000000000)
|
||||
ctx, cancel = context.WithTimeout(ctx, td)
|
||||
defer cancel()
|
||||
return h.TestServer.Call(ctx, req, rsp)
|
||||
}
|
||||
|
@ -1,37 +0,0 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-micro v3.10.1
|
||||
// - protoc v3.21.12
|
||||
// source: test.proto
|
||||
|
||||
package pb
|
||||
|
||||
import (
|
||||
context "context"
|
||||
v3 "go.unistack.org/micro-server-http/v3"
|
||||
proto "go.unistack.org/micro-tests/server/combo/proto"
|
||||
client "go.unistack.org/micro/v3/client"
|
||||
)
|
||||
|
||||
var (
|
||||
TestName = "Test"
|
||||
)
|
||||
var (
|
||||
TestServerEndpoints = []v3.EndpointMetadata{
|
||||
{
|
||||
Name: "Test.Call",
|
||||
Path: "/v1/call",
|
||||
Method: "POST",
|
||||
Body: "*",
|
||||
Stream: false,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
type TestClient interface {
|
||||
Call(ctx context.Context, req *proto.CallReq, opts ...client.CallOption) (*proto.CallRsp, error)
|
||||
}
|
||||
|
||||
type TestServer interface {
|
||||
Call(ctx context.Context, req *proto.CallReq, rsp *proto.CallRsp) error
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-micro v3.10.1
|
||||
// - protoc-gen-go-micro v3.10.2
|
||||
// - protoc v3.21.12
|
||||
// source: test.proto
|
||||
// source: proto.proto
|
||||
|
||||
package pb
|
||||
|
||||
@ -20,7 +20,7 @@ var (
|
||||
TestServerEndpoints = []v3.EndpointMetadata{
|
||||
{
|
||||
Name: "Test.Call",
|
||||
Path: "/v1/call",
|
||||
Path: "/Call",
|
||||
Method: "POST",
|
||||
Body: "*",
|
||||
Stream: false,
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// protoc-gen-go-micro version: v3.10.1
|
||||
// source: test.proto
|
||||
// protoc-gen-go-micro version: v3.10.2
|
||||
// source: proto.proto
|
||||
|
||||
package pb
|
||||
|
||||
@ -12,7 +12,6 @@ import (
|
||||
client "go.unistack.org/micro/v3/client"
|
||||
server "go.unistack.org/micro/v3/server"
|
||||
http "net/http"
|
||||
time "time"
|
||||
)
|
||||
|
||||
type testClient struct {
|
||||
@ -32,11 +31,9 @@ func (c *testClient) Call(ctx context.Context, req *proto.CallReq, opts ...clien
|
||||
)
|
||||
opts = append(opts,
|
||||
v3.Method(http.MethodPost),
|
||||
v3.Path("/v1/call"),
|
||||
v3.Path("/Call"),
|
||||
v3.Body("*"),
|
||||
)
|
||||
td := time.Duration(5000000000)
|
||||
opts = append(opts, client.WithRequestTimeout(td))
|
||||
rsp := &proto.CallRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "Test.Call", req), rsp, opts...)
|
||||
if err != nil {
|
||||
@ -50,10 +47,6 @@ type testServer struct {
|
||||
}
|
||||
|
||||
func (h *testServer) Call(ctx context.Context, req *proto.CallReq, rsp *proto.CallRsp) error {
|
||||
var cancel context.CancelFunc
|
||||
td := time.Duration(5000000000)
|
||||
ctx, cancel = context.WithTimeout(ctx, td)
|
||||
defer cancel()
|
||||
return h.TestServer.Call(ctx, req, rsp)
|
||||
}
|
||||
|
@ -1,102 +0,0 @@
|
||||
// Code generated by protoc-gen-go-drpc. DO NOT EDIT.
|
||||
// protoc-gen-go-drpc version: v0.0.32
|
||||
// source: test.proto
|
||||
|
||||
package pb
|
||||
|
||||
import (
|
||||
context "context"
|
||||
errors "errors"
|
||||
proto "google.golang.org/protobuf/proto"
|
||||
drpc "storj.io/drpc"
|
||||
drpcerr "storj.io/drpc/drpcerr"
|
||||
)
|
||||
|
||||
type drpcEncoding_File_test_proto struct{}
|
||||
|
||||
func (drpcEncoding_File_test_proto) Marshal(msg drpc.Message) ([]byte, error) {
|
||||
return proto.Marshal(msg.(proto.Message))
|
||||
}
|
||||
|
||||
func (drpcEncoding_File_test_proto) MarshalAppend(buf []byte, msg drpc.Message) ([]byte, error) {
|
||||
return proto.MarshalOptions{}.MarshalAppend(buf, msg.(proto.Message))
|
||||
}
|
||||
|
||||
func (drpcEncoding_File_test_proto) Unmarshal(buf []byte, msg drpc.Message) error {
|
||||
return proto.Unmarshal(buf, msg.(proto.Message))
|
||||
}
|
||||
|
||||
type DRPCTestClient interface {
|
||||
DRPCConn() drpc.Conn
|
||||
|
||||
Call(ctx context.Context, in *CallReq) (*CallRsp, error)
|
||||
}
|
||||
|
||||
type drpcTestClient struct {
|
||||
cc drpc.Conn
|
||||
}
|
||||
|
||||
func NewDRPCTestClient(cc drpc.Conn) DRPCTestClient {
|
||||
return &drpcTestClient{cc}
|
||||
}
|
||||
|
||||
func (c *drpcTestClient) DRPCConn() drpc.Conn { return c.cc }
|
||||
|
||||
func (c *drpcTestClient) Call(ctx context.Context, in *CallReq) (*CallRsp, error) {
|
||||
out := new(CallRsp)
|
||||
err := c.cc.Invoke(ctx, "/test.v1.Test/Call", drpcEncoding_File_test_proto{}, in, out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
type DRPCTestServer interface {
|
||||
Call(context.Context, *CallReq) (*CallRsp, error)
|
||||
}
|
||||
|
||||
type DRPCTestUnimplementedServer struct{}
|
||||
|
||||
func (s *DRPCTestUnimplementedServer) Call(context.Context, *CallReq) (*CallRsp, error) {
|
||||
return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
|
||||
}
|
||||
|
||||
type DRPCTestDescription struct{}
|
||||
|
||||
func (DRPCTestDescription) NumMethods() int { return 1 }
|
||||
|
||||
func (DRPCTestDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) {
|
||||
switch n {
|
||||
case 0:
|
||||
return "/test.v1.Test/Call", drpcEncoding_File_test_proto{},
|
||||
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
|
||||
return srv.(DRPCTestServer).
|
||||
Call(
|
||||
ctx,
|
||||
in1.(*CallReq),
|
||||
)
|
||||
}, DRPCTestServer.Call, true
|
||||
default:
|
||||
return "", nil, nil, nil, false
|
||||
}
|
||||
}
|
||||
|
||||
func DRPCRegisterTest(mux drpc.Mux, impl DRPCTestServer) error {
|
||||
return mux.Register(impl, DRPCTestDescription{})
|
||||
}
|
||||
|
||||
type DRPCTest_CallStream interface {
|
||||
drpc.Stream
|
||||
SendAndClose(*CallRsp) error
|
||||
}
|
||||
|
||||
type drpcTest_CallStream struct {
|
||||
drpc.Stream
|
||||
}
|
||||
|
||||
func (x *drpcTest_CallStream) SendAndClose(m *CallRsp) error {
|
||||
if err := x.MsgSend(m, drpcEncoding_File_test_proto{}); err != nil {
|
||||
return err
|
||||
}
|
||||
return x.CloseSend()
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.21.12
|
||||
// source: test.proto
|
||||
// source: ngpb.proto
|
||||
|
||||
package pb
|
||||
|
||||
@ -35,7 +35,7 @@ type CallReq struct {
|
||||
func (x *CallReq) Reset() {
|
||||
*x = CallReq{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_test_proto_msgTypes[0]
|
||||
mi := &file_ngpb_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -48,7 +48,7 @@ func (x *CallReq) String() string {
|
||||
func (*CallReq) ProtoMessage() {}
|
||||
|
||||
func (x *CallReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_test_proto_msgTypes[0]
|
||||
mi := &file_ngpb_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -61,7 +61,7 @@ func (x *CallReq) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use CallReq.ProtoReflect.Descriptor instead.
|
||||
func (*CallReq) Descriptor() ([]byte, []int) {
|
||||
return file_test_proto_rawDescGZIP(), []int{0}
|
||||
return file_ngpb_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *CallReq) GetReq() string {
|
||||
@ -82,7 +82,7 @@ type CallRsp struct {
|
||||
func (x *CallRsp) Reset() {
|
||||
*x = CallRsp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_test_proto_msgTypes[1]
|
||||
mi := &file_ngpb_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -95,7 +95,7 @@ func (x *CallRsp) String() string {
|
||||
func (*CallRsp) ProtoMessage() {}
|
||||
|
||||
func (x *CallRsp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_test_proto_msgTypes[1]
|
||||
mi := &file_ngpb_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -108,7 +108,7 @@ func (x *CallRsp) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use CallRsp.ProtoReflect.Descriptor instead.
|
||||
func (*CallRsp) Descriptor() ([]byte, []int) {
|
||||
return file_test_proto_rawDescGZIP(), []int{1}
|
||||
return file_ngpb_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *CallRsp) GetRsp() string {
|
||||
@ -129,7 +129,7 @@ type Error struct {
|
||||
func (x *Error) Reset() {
|
||||
*x = Error{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_test_proto_msgTypes[2]
|
||||
mi := &file_ngpb_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -142,7 +142,7 @@ func (x *Error) String() string {
|
||||
func (*Error) ProtoMessage() {}
|
||||
|
||||
func (x *Error) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_test_proto_msgTypes[2]
|
||||
mi := &file_ngpb_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -155,7 +155,7 @@ func (x *Error) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use Error.ProtoReflect.Descriptor instead.
|
||||
func (*Error) Descriptor() ([]byte, []int) {
|
||||
return file_test_proto_rawDescGZIP(), []int{2}
|
||||
return file_ngpb_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *Error) GetErr() string {
|
||||
@ -165,56 +165,57 @@ func (x *Error) GetErr() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_test_proto protoreflect.FileDescriptor
|
||||
var File_ngpb_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_test_proto_rawDesc = []byte{
|
||||
0x0a, 0x0a, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x74, 0x65,
|
||||
0x73, 0x74, 0x2e, 0x76, 0x31, 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, 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, 0x1b, 0x0a, 0x07, 0x43, 0x61, 0x6c, 0x6c,
|
||||
0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x03, 0x72, 0x65, 0x71, 0x22, 0x1b, 0x0a, 0x07, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x73, 0x70,
|
||||
0x12, 0x10, 0x0a, 0x03, 0x72, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72,
|
||||
0x73, 0x70, 0x22, 0x19, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x65,
|
||||
0x72, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x65, 0x72, 0x72, 0x32, 0x72, 0x0a,
|
||||
0x04, 0x54, 0x65, 0x73, 0x74, 0x12, 0x6a, 0x0a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x10, 0x2e,
|
||||
0x74, 0x65, 0x73, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x1a,
|
||||
0x10, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x73,
|
||||
0x70, 0x22, 0x3e, 0xaa, 0x84, 0x9e, 0x03, 0x1c, 0x2a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x42, 0x14,
|
||||
0x0a, 0x12, 0x12, 0x10, 0x0a, 0x0e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x45,
|
||||
0x72, 0x72, 0x6f, 0x72, 0xb2, 0xea, 0xff, 0xf9, 0x01, 0x0d, 0x22, 0x08, 0x2f, 0x76, 0x31, 0x2f,
|
||||
0x63, 0x61, 0x6c, 0x6c, 0x3a, 0x01, 0x2a, 0xba, 0xea, 0xff, 0xf9, 0x01, 0x04, 0x0a, 0x02, 0x35,
|
||||
0x73, 0x42, 0x33, 0x5a, 0x31, 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, 0x63, 0x6f, 0x6d, 0x62, 0x6f, 0x2f, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
var file_ngpb_proto_rawDesc = []byte{
|
||||
0x0a, 0x0a, 0x6e, 0x67, 0x70, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x74, 0x65,
|
||||
0x73, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x6e, 0x67, 0x70, 0x62, 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, 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, 0x1b, 0x0a,
|
||||
0x07, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x71, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, 0x71, 0x22, 0x1b, 0x0a, 0x07, 0x43, 0x61,
|
||||
0x6c, 0x6c, 0x52, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x03, 0x72, 0x73, 0x70, 0x22, 0x19, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72,
|
||||
0x12, 0x10, 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x65,
|
||||
0x72, 0x72, 0x32, 0x7c, 0x0a, 0x04, 0x54, 0x65, 0x73, 0x74, 0x12, 0x74, 0x0a, 0x04, 0x43, 0x61,
|
||||
0x6c, 0x6c, 0x12, 0x15, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x6e, 0x67, 0x70,
|
||||
0x62, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x74, 0x65, 0x73, 0x74,
|
||||
0x2e, 0x76, 0x31, 0x2e, 0x6e, 0x67, 0x70, 0x62, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x73, 0x70,
|
||||
0x22, 0x3e, 0xaa, 0x84, 0x9e, 0x03, 0x1c, 0x2a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x42, 0x14, 0x0a,
|
||||
0x12, 0x12, 0x10, 0x0a, 0x0e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x72,
|
||||
0x72, 0x6f, 0x72, 0xb2, 0xea, 0xff, 0xf9, 0x01, 0x0d, 0x22, 0x08, 0x2f, 0x76, 0x31, 0x2f, 0x63,
|
||||
0x61, 0x6c, 0x6c, 0x3a, 0x01, 0x2a, 0xba, 0xea, 0xff, 0xf9, 0x01, 0x04, 0x0a, 0x02, 0x35, 0x73,
|
||||
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, 0x63, 0x6f, 0x6d, 0x62, 0x6f, 0x2f, 0x6e, 0x67, 0x70,
|
||||
0x62, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_test_proto_rawDescOnce sync.Once
|
||||
file_test_proto_rawDescData = file_test_proto_rawDesc
|
||||
file_ngpb_proto_rawDescOnce sync.Once
|
||||
file_ngpb_proto_rawDescData = file_ngpb_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_test_proto_rawDescGZIP() []byte {
|
||||
file_test_proto_rawDescOnce.Do(func() {
|
||||
file_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_test_proto_rawDescData)
|
||||
func file_ngpb_proto_rawDescGZIP() []byte {
|
||||
file_ngpb_proto_rawDescOnce.Do(func() {
|
||||
file_ngpb_proto_rawDescData = protoimpl.X.CompressGZIP(file_ngpb_proto_rawDescData)
|
||||
})
|
||||
return file_test_proto_rawDescData
|
||||
return file_ngpb_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_test_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_test_proto_goTypes = []interface{}{
|
||||
(*CallReq)(nil), // 0: test.v1.CallReq
|
||||
(*CallRsp)(nil), // 1: test.v1.CallRsp
|
||||
(*Error)(nil), // 2: test.v1.Error
|
||||
var file_ngpb_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_ngpb_proto_goTypes = []interface{}{
|
||||
(*CallReq)(nil), // 0: test.v1.ngpb.CallReq
|
||||
(*CallRsp)(nil), // 1: test.v1.ngpb.CallRsp
|
||||
(*Error)(nil), // 2: test.v1.ngpb.Error
|
||||
}
|
||||
var file_test_proto_depIdxs = []int32{
|
||||
0, // 0: test.v1.Test.Call:input_type -> test.v1.CallReq
|
||||
1, // 1: test.v1.Test.Call:output_type -> test.v1.CallRsp
|
||||
var file_ngpb_proto_depIdxs = []int32{
|
||||
0, // 0: test.v1.ngpb.Test.Call:input_type -> test.v1.ngpb.CallReq
|
||||
1, // 1: test.v1.ngpb.Test.Call:output_type -> test.v1.ngpb.CallRsp
|
||||
1, // [1:2] is the sub-list for method output_type
|
||||
0, // [0:1] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
@ -222,13 +223,13 @@ var file_test_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_test_proto_init() }
|
||||
func file_test_proto_init() {
|
||||
if File_test_proto != nil {
|
||||
func init() { file_ngpb_proto_init() }
|
||||
func file_ngpb_proto_init() {
|
||||
if File_ngpb_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_ngpb_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CallReq); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@ -240,7 +241,7 @@ func file_test_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_test_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_ngpb_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CallRsp); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@ -252,7 +253,7 @@ func file_test_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_test_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_ngpb_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Error); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@ -269,18 +270,18 @@ func file_test_proto_init() {
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_test_proto_rawDesc,
|
||||
RawDescriptor: file_ngpb_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 3,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_test_proto_goTypes,
|
||||
DependencyIndexes: file_test_proto_depIdxs,
|
||||
MessageInfos: file_test_proto_msgTypes,
|
||||
GoTypes: file_ngpb_proto_goTypes,
|
||||
DependencyIndexes: file_ngpb_proto_depIdxs,
|
||||
MessageInfos: file_ngpb_proto_msgTypes,
|
||||
}.Build()
|
||||
File_test_proto = out.File
|
||||
file_test_proto_rawDesc = nil
|
||||
file_test_proto_goTypes = nil
|
||||
file_test_proto_depIdxs = nil
|
||||
File_ngpb_proto = out.File
|
||||
file_ngpb_proto_rawDesc = nil
|
||||
file_ngpb_proto_goTypes = nil
|
||||
file_ngpb_proto_depIdxs = nil
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package test.v1;
|
||||
package test.v1.ngpb;
|
||||
|
||||
option go_package = "go.unistack.org/micro-tests/server/combo/proto;pb";
|
||||
option go_package = "go.unistack.org/micro-tests/server/combo/ngpb;pb";
|
||||
|
||||
import "tag/tag.proto";
|
||||
import "api/annotations.proto";
|
@ -1,8 +1,8 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc v3.21.12
|
||||
// source: test.proto
|
||||
// source: ngpb.proto
|
||||
|
||||
package pb
|
||||
|
||||
@ -18,6 +18,10 @@ import (
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
Test_Call_FullMethodName = "/test.v1.ngpb.Test/Call"
|
||||
)
|
||||
|
||||
// TestClient is the client API for Test service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
@ -36,7 +40,7 @@ func NewTestClient(cc grpc.ClientConnInterface) TestClient {
|
||||
|
||||
func (c *testClient) Call(ctx context.Context, in *CallReq, opts ...grpc.CallOption) (*CallRsp, error) {
|
||||
out := new(CallRsp)
|
||||
err := c.cc.Invoke(ctx, "/test.v1.Test/Call", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, Test_Call_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -82,7 +86,7 @@ func _Test_Call_Handler(srv interface{}, ctx context.Context, dec func(interface
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/test.v1.Test/Call",
|
||||
FullMethod: Test_Call_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TestServer).Call(ctx, req.(*CallReq))
|
||||
@ -94,7 +98,7 @@ func _Test_Call_Handler(srv interface{}, ctx context.Context, dec func(interface
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var Test_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "test.v1.Test",
|
||||
ServiceName: "test.v1.ngpb.Test",
|
||||
HandlerType: (*TestServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
@ -103,5 +107,5 @@ var Test_ServiceDesc = grpc.ServiceDesc{
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "test.proto",
|
||||
Metadata: "ngpb.proto",
|
||||
}
|
50
server/combo/proto/apidocs.swagger.yaml
Normal file
50
server/combo/proto/apidocs.swagger.yaml
Normal file
@ -0,0 +1,50 @@
|
||||
# Generated with protoc-gen-go-micro
|
||||
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Test API
|
||||
version: 0.0.1
|
||||
paths:
|
||||
/Call:
|
||||
post:
|
||||
tags:
|
||||
- Test
|
||||
operationId: Call
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CallReq'
|
||||
required: true
|
||||
responses:
|
||||
default:
|
||||
description: Default
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
"200":
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CallRsp'
|
||||
components:
|
||||
schemas:
|
||||
CallReq:
|
||||
type: object
|
||||
properties:
|
||||
req:
|
||||
type: string
|
||||
CallRsp:
|
||||
type: object
|
||||
properties:
|
||||
rsp:
|
||||
type: string
|
||||
Error:
|
||||
type: object
|
||||
properties:
|
||||
err:
|
||||
type: string
|
||||
tags:
|
||||
- name: Test
|
@ -2,7 +2,7 @@
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.21.12
|
||||
// source: test.proto
|
||||
// source: proto.proto
|
||||
|
||||
package pb
|
||||
|
||||
@ -35,7 +35,7 @@ type CallReq struct {
|
||||
func (x *CallReq) Reset() {
|
||||
*x = CallReq{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_test_proto_msgTypes[0]
|
||||
mi := &file_proto_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -48,7 +48,7 @@ func (x *CallReq) String() string {
|
||||
func (*CallReq) ProtoMessage() {}
|
||||
|
||||
func (x *CallReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_test_proto_msgTypes[0]
|
||||
mi := &file_proto_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -61,7 +61,7 @@ func (x *CallReq) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use CallReq.ProtoReflect.Descriptor instead.
|
||||
func (*CallReq) Descriptor() ([]byte, []int) {
|
||||
return file_test_proto_rawDescGZIP(), []int{0}
|
||||
return file_proto_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *CallReq) GetReq() string {
|
||||
@ -82,7 +82,7 @@ type CallRsp struct {
|
||||
func (x *CallRsp) Reset() {
|
||||
*x = CallRsp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_test_proto_msgTypes[1]
|
||||
mi := &file_proto_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -95,7 +95,7 @@ func (x *CallRsp) String() string {
|
||||
func (*CallRsp) ProtoMessage() {}
|
||||
|
||||
func (x *CallRsp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_test_proto_msgTypes[1]
|
||||
mi := &file_proto_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -108,7 +108,7 @@ func (x *CallRsp) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use CallRsp.ProtoReflect.Descriptor instead.
|
||||
func (*CallRsp) Descriptor() ([]byte, []int) {
|
||||
return file_test_proto_rawDescGZIP(), []int{1}
|
||||
return file_proto_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *CallRsp) GetRsp() string {
|
||||
@ -129,7 +129,7 @@ type Error struct {
|
||||
func (x *Error) Reset() {
|
||||
*x = Error{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_test_proto_msgTypes[2]
|
||||
mi := &file_proto_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -142,7 +142,7 @@ func (x *Error) String() string {
|
||||
func (*Error) ProtoMessage() {}
|
||||
|
||||
func (x *Error) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_test_proto_msgTypes[2]
|
||||
mi := &file_proto_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -155,7 +155,7 @@ func (x *Error) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use Error.ProtoReflect.Descriptor instead.
|
||||
func (*Error) Descriptor() ([]byte, []int) {
|
||||
return file_test_proto_rawDescGZIP(), []int{2}
|
||||
return file_proto_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *Error) GetErr() string {
|
||||
@ -165,56 +165,57 @@ func (x *Error) GetErr() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_test_proto protoreflect.FileDescriptor
|
||||
var File_proto_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_test_proto_rawDesc = []byte{
|
||||
0x0a, 0x0a, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x74, 0x65,
|
||||
0x73, 0x74, 0x2e, 0x76, 0x31, 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, 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, 0x1b, 0x0a, 0x07, 0x43, 0x61, 0x6c, 0x6c,
|
||||
0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x03, 0x72, 0x65, 0x71, 0x22, 0x1b, 0x0a, 0x07, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x73, 0x70,
|
||||
0x12, 0x10, 0x0a, 0x03, 0x72, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72,
|
||||
0x73, 0x70, 0x22, 0x19, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x65,
|
||||
0x72, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x65, 0x72, 0x72, 0x32, 0x72, 0x0a,
|
||||
0x04, 0x54, 0x65, 0x73, 0x74, 0x12, 0x6a, 0x0a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x10, 0x2e,
|
||||
0x74, 0x65, 0x73, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x1a,
|
||||
0x10, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x73,
|
||||
0x70, 0x22, 0x3e, 0xaa, 0x84, 0x9e, 0x03, 0x1c, 0x2a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x42, 0x14,
|
||||
0x0a, 0x12, 0x12, 0x10, 0x0a, 0x0e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x45,
|
||||
0x72, 0x72, 0x6f, 0x72, 0xb2, 0xea, 0xff, 0xf9, 0x01, 0x0d, 0x22, 0x08, 0x2f, 0x76, 0x31, 0x2f,
|
||||
0x63, 0x61, 0x6c, 0x6c, 0x3a, 0x01, 0x2a, 0xba, 0xea, 0xff, 0xf9, 0x01, 0x04, 0x0a, 0x02, 0x35,
|
||||
0x73, 0x42, 0x33, 0x5a, 0x31, 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, 0x63, 0x6f, 0x6d, 0x62, 0x6f, 0x2f, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
var file_proto_proto_rawDesc = []byte{
|
||||
0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x74,
|
||||
0x65, 0x73, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 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, 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,
|
||||
0x1b, 0x0a, 0x07, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65,
|
||||
0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, 0x71, 0x22, 0x1b, 0x0a, 0x07,
|
||||
0x43, 0x61, 0x6c, 0x6c, 0x52, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x73, 0x70, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x73, 0x70, 0x22, 0x19, 0x0a, 0x05, 0x45, 0x72, 0x72,
|
||||
0x6f, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x03, 0x65, 0x72, 0x72, 0x32, 0x77, 0x0a, 0x04, 0x54, 0x65, 0x73, 0x74, 0x12, 0x6f, 0x0a, 0x04,
|
||||
0x43, 0x61, 0x6c, 0x6c, 0x12, 0x16, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x74,
|
||||
0x65, 0x73, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x61, 0x6c,
|
||||
0x6c, 0x52, 0x73, 0x70, 0x22, 0x37, 0xaa, 0x84, 0x9e, 0x03, 0x22, 0x2a, 0x04, 0x43, 0x61, 0x6c,
|
||||
0x6c, 0x42, 0x1a, 0x0a, 0x18, 0x12, 0x16, 0x0a, 0x14, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x76,
|
||||
0x31, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0xb2, 0xea, 0xff,
|
||||
0xf9, 0x01, 0x0a, 0x22, 0x05, 0x2f, 0x43, 0x61, 0x6c, 0x6c, 0x3a, 0x01, 0x2a, 0x42, 0x33, 0x5a,
|
||||
0x31, 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, 0x63, 0x6f, 0x6d, 0x62, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b,
|
||||
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_test_proto_rawDescOnce sync.Once
|
||||
file_test_proto_rawDescData = file_test_proto_rawDesc
|
||||
file_proto_proto_rawDescOnce sync.Once
|
||||
file_proto_proto_rawDescData = file_proto_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_test_proto_rawDescGZIP() []byte {
|
||||
file_test_proto_rawDescOnce.Do(func() {
|
||||
file_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_test_proto_rawDescData)
|
||||
func file_proto_proto_rawDescGZIP() []byte {
|
||||
file_proto_proto_rawDescOnce.Do(func() {
|
||||
file_proto_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_proto_rawDescData)
|
||||
})
|
||||
return file_test_proto_rawDescData
|
||||
return file_proto_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_test_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_test_proto_goTypes = []interface{}{
|
||||
(*CallReq)(nil), // 0: test.v1.CallReq
|
||||
(*CallRsp)(nil), // 1: test.v1.CallRsp
|
||||
(*Error)(nil), // 2: test.v1.Error
|
||||
var file_proto_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_proto_proto_goTypes = []interface{}{
|
||||
(*CallReq)(nil), // 0: test.v1.proto.CallReq
|
||||
(*CallRsp)(nil), // 1: test.v1.proto.CallRsp
|
||||
(*Error)(nil), // 2: test.v1.proto.Error
|
||||
}
|
||||
var file_test_proto_depIdxs = []int32{
|
||||
0, // 0: test.v1.Test.Call:input_type -> test.v1.CallReq
|
||||
1, // 1: test.v1.Test.Call:output_type -> test.v1.CallRsp
|
||||
var file_proto_proto_depIdxs = []int32{
|
||||
0, // 0: test.v1.proto.Test.Call:input_type -> test.v1.proto.CallReq
|
||||
1, // 1: test.v1.proto.Test.Call:output_type -> test.v1.proto.CallRsp
|
||||
1, // [1:2] is the sub-list for method output_type
|
||||
0, // [0:1] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
@ -222,13 +223,13 @@ var file_test_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_test_proto_init() }
|
||||
func file_test_proto_init() {
|
||||
if File_test_proto != nil {
|
||||
func init() { file_proto_proto_init() }
|
||||
func file_proto_proto_init() {
|
||||
if File_proto_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_proto_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CallReq); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@ -240,7 +241,7 @@ func file_test_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_test_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_proto_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CallRsp); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@ -252,7 +253,7 @@ func file_test_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_test_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_proto_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Error); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@ -269,18 +270,18 @@ func file_test_proto_init() {
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_test_proto_rawDesc,
|
||||
RawDescriptor: file_proto_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 3,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_test_proto_goTypes,
|
||||
DependencyIndexes: file_test_proto_depIdxs,
|
||||
MessageInfos: file_test_proto_msgTypes,
|
||||
GoTypes: file_proto_proto_goTypes,
|
||||
DependencyIndexes: file_proto_proto_depIdxs,
|
||||
MessageInfos: file_proto_proto_msgTypes,
|
||||
}.Build()
|
||||
File_test_proto = out.File
|
||||
file_test_proto_rawDesc = nil
|
||||
file_test_proto_goTypes = nil
|
||||
file_test_proto_depIdxs = nil
|
||||
File_proto_proto = out.File
|
||||
file_proto_proto_rawDesc = nil
|
||||
file_proto_proto_goTypes = nil
|
||||
file_proto_proto_depIdxs = nil
|
||||
}
|
38
server/combo/proto/proto.proto
Normal file
38
server/combo/proto/proto.proto
Normal file
@ -0,0 +1,38 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package test.v1.proto;
|
||||
|
||||
option go_package = "go.unistack.org/micro-tests/server/combo/proto;pb";
|
||||
|
||||
import "tag/tag.proto";
|
||||
import "api/annotations.proto";
|
||||
import "openapiv3/annotations.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
|
||||
service Test {
|
||||
rpc Call(CallReq) returns (CallRsp) {
|
||||
option (micro.openapiv3.openapiv3_operation) = {
|
||||
operation_id: "Call";
|
||||
responses: {
|
||||
default: {
|
||||
reference: {
|
||||
_ref: ".test.v1.proto.Error";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
option (micro.api.http) = { post: "/Call"; body: "*"; };
|
||||
};
|
||||
};
|
||||
|
||||
message CallReq {
|
||||
string req = 1;
|
||||
};
|
||||
|
||||
message CallRsp {
|
||||
string rsp = 1;
|
||||
};
|
||||
|
||||
message Error {
|
||||
string err = 1;
|
||||
};
|
@ -1,286 +0,0 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.21.12
|
||||
// source: test.proto
|
||||
|
||||
package pb
|
||||
|
||||
import (
|
||||
_ "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"
|
||||
_ "google.golang.org/protobuf/types/known/wrapperspb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type CallReq struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Req string `protobuf:"bytes,1,opt,name=req,proto3" json:"req,omitempty"`
|
||||
}
|
||||
|
||||
func (x *CallReq) Reset() {
|
||||
*x = CallReq{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_test_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CallReq) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CallReq) ProtoMessage() {}
|
||||
|
||||
func (x *CallReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_test_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CallReq.ProtoReflect.Descriptor instead.
|
||||
func (*CallReq) Descriptor() ([]byte, []int) {
|
||||
return file_test_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *CallReq) GetReq() string {
|
||||
if x != nil {
|
||||
return x.Req
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type CallRsp struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Rsp string `protobuf:"bytes,1,opt,name=rsp,proto3" json:"rsp,omitempty"`
|
||||
}
|
||||
|
||||
func (x *CallRsp) Reset() {
|
||||
*x = CallRsp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_test_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CallRsp) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CallRsp) ProtoMessage() {}
|
||||
|
||||
func (x *CallRsp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_test_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CallRsp.ProtoReflect.Descriptor instead.
|
||||
func (*CallRsp) Descriptor() ([]byte, []int) {
|
||||
return file_test_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *CallRsp) GetRsp() string {
|
||||
if x != nil {
|
||||
return x.Rsp
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type Error struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Err string `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Error) Reset() {
|
||||
*x = Error{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_test_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Error) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Error) ProtoMessage() {}
|
||||
|
||||
func (x *Error) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_test_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Error.ProtoReflect.Descriptor instead.
|
||||
func (*Error) Descriptor() ([]byte, []int) {
|
||||
return file_test_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *Error) GetErr() string {
|
||||
if x != nil {
|
||||
return x.Err
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
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, 0x07, 0x74, 0x65,
|
||||
0x73, 0x74, 0x2e, 0x76, 0x31, 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, 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, 0x1b, 0x0a, 0x07, 0x43, 0x61, 0x6c, 0x6c,
|
||||
0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x03, 0x72, 0x65, 0x71, 0x22, 0x1b, 0x0a, 0x07, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x73, 0x70,
|
||||
0x12, 0x10, 0x0a, 0x03, 0x72, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72,
|
||||
0x73, 0x70, 0x22, 0x19, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x65,
|
||||
0x72, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x65, 0x72, 0x72, 0x32, 0x72, 0x0a,
|
||||
0x04, 0x54, 0x65, 0x73, 0x74, 0x12, 0x6a, 0x0a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x10, 0x2e,
|
||||
0x74, 0x65, 0x73, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x1a,
|
||||
0x10, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x73,
|
||||
0x70, 0x22, 0x3e, 0xaa, 0x84, 0x9e, 0x03, 0x1c, 0x2a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x42, 0x14,
|
||||
0x0a, 0x12, 0x12, 0x10, 0x0a, 0x0e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x45,
|
||||
0x72, 0x72, 0x6f, 0x72, 0xb2, 0xea, 0xff, 0xf9, 0x01, 0x0d, 0x22, 0x08, 0x2f, 0x76, 0x31, 0x2f,
|
||||
0x63, 0x61, 0x6c, 0x6c, 0x3a, 0x01, 0x2a, 0xba, 0xea, 0xff, 0xf9, 0x01, 0x04, 0x0a, 0x02, 0x35,
|
||||
0x73, 0x42, 0x33, 0x5a, 0x31, 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, 0x63, 0x6f, 0x6d, 0x62, 0x6f, 0x2f, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_test_proto_rawDescOnce sync.Once
|
||||
file_test_proto_rawDescData = file_test_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_test_proto_rawDescGZIP() []byte {
|
||||
file_test_proto_rawDescOnce.Do(func() {
|
||||
file_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_test_proto_rawDescData)
|
||||
})
|
||||
return file_test_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_test_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_test_proto_goTypes = []interface{}{
|
||||
(*CallReq)(nil), // 0: test.v1.CallReq
|
||||
(*CallRsp)(nil), // 1: test.v1.CallRsp
|
||||
(*Error)(nil), // 2: test.v1.Error
|
||||
}
|
||||
var file_test_proto_depIdxs = []int32{
|
||||
0, // 0: test.v1.Test.Call:input_type -> test.v1.CallReq
|
||||
1, // 1: test.v1.Test.Call:output_type -> test.v1.CallRsp
|
||||
1, // [1:2] is the sub-list for method output_type
|
||||
0, // [0:1] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_test_proto_init() }
|
||||
func file_test_proto_init() {
|
||||
if File_test_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CallReq); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_test_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CallRsp); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_test_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Error); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_test_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 3,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_test_proto_goTypes,
|
||||
DependencyIndexes: file_test_proto_depIdxs,
|
||||
MessageInfos: file_test_proto_msgTypes,
|
||||
}.Build()
|
||||
File_test_proto = out.File
|
||||
file_test_proto_rawDesc = nil
|
||||
file_test_proto_goTypes = nil
|
||||
file_test_proto_depIdxs = nil
|
||||
}
|
BIN
server/combo/swagger-ui/favicon-16x16.png
Normal file
BIN
server/combo/swagger-ui/favicon-16x16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 665 B |
BIN
server/combo/swagger-ui/favicon-32x32.png
Normal file
BIN
server/combo/swagger-ui/favicon-32x32.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 628 B |
16
server/combo/swagger-ui/index.css
Normal file
16
server/combo/swagger-ui/index.css
Normal file
@ -0,0 +1,16 @@
|
||||
html {
|
||||
box-sizing: border-box;
|
||||
overflow: -moz-scrollbars-vertical;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
*,
|
||||
*:before,
|
||||
*:after {
|
||||
box-sizing: inherit;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
background: #fafafa;
|
||||
}
|
19
server/combo/swagger-ui/index.html
Normal file
19
server/combo/swagger-ui/index.html
Normal file
@ -0,0 +1,19 @@
|
||||
<!-- HTML for static distribution bundle build -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Swagger UI</title>
|
||||
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" />
|
||||
<link rel="stylesheet" type="text/css" href="index.css" />
|
||||
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
|
||||
<link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="swagger-ui"></div>
|
||||
<script src="./swagger-ui-bundle.js" charset="UTF-8"> </script>
|
||||
<script src="./swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
|
||||
<script src="./swagger-initializer.js" charset="UTF-8"> </script>
|
||||
</body>
|
||||
</html>
|
79
server/combo/swagger-ui/oauth2-redirect.html
Normal file
79
server/combo/swagger-ui/oauth2-redirect.html
Normal file
@ -0,0 +1,79 @@
|
||||
<!doctype html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<title>Swagger UI: OAuth2 Redirect</title>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
'use strict';
|
||||
function run () {
|
||||
var oauth2 = window.opener.swaggerUIRedirectOauth2;
|
||||
var sentState = oauth2.state;
|
||||
var redirectUrl = oauth2.redirectUrl;
|
||||
var isValid, qp, arr;
|
||||
|
||||
if (/code|token|error/.test(window.location.hash)) {
|
||||
qp = window.location.hash.substring(1).replace('?', '&');
|
||||
} else {
|
||||
qp = location.search.substring(1);
|
||||
}
|
||||
|
||||
arr = qp.split("&");
|
||||
arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';});
|
||||
qp = qp ? JSON.parse('{' + arr.join() + '}',
|
||||
function (key, value) {
|
||||
return key === "" ? value : decodeURIComponent(value);
|
||||
}
|
||||
) : {};
|
||||
|
||||
isValid = qp.state === sentState;
|
||||
|
||||
if ((
|
||||
oauth2.auth.schema.get("flow") === "accessCode" ||
|
||||
oauth2.auth.schema.get("flow") === "authorizationCode" ||
|
||||
oauth2.auth.schema.get("flow") === "authorization_code"
|
||||
) && !oauth2.auth.code) {
|
||||
if (!isValid) {
|
||||
oauth2.errCb({
|
||||
authId: oauth2.auth.name,
|
||||
source: "auth",
|
||||
level: "warning",
|
||||
message: "Authorization may be unsafe, passed state was changed in server. The passed state wasn't returned from auth server."
|
||||
});
|
||||
}
|
||||
|
||||
if (qp.code) {
|
||||
delete oauth2.state;
|
||||
oauth2.auth.code = qp.code;
|
||||
oauth2.callback({auth: oauth2.auth, redirectUrl: redirectUrl});
|
||||
} else {
|
||||
let oauthErrorMsg;
|
||||
if (qp.error) {
|
||||
oauthErrorMsg = "["+qp.error+"]: " +
|
||||
(qp.error_description ? qp.error_description+ ". " : "no accessCode received from the server. ") +
|
||||
(qp.error_uri ? "More info: "+qp.error_uri : "");
|
||||
}
|
||||
|
||||
oauth2.errCb({
|
||||
authId: oauth2.auth.name,
|
||||
source: "auth",
|
||||
level: "error",
|
||||
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server."
|
||||
});
|
||||
}
|
||||
} else {
|
||||
oauth2.callback({auth: oauth2.auth, token: qp, isValid: isValid, redirectUrl: redirectUrl});
|
||||
}
|
||||
window.close();
|
||||
}
|
||||
|
||||
if (document.readyState !== 'loading') {
|
||||
run();
|
||||
} else {
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
run();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
20
server/combo/swagger-ui/swagger-initializer.js
Normal file
20
server/combo/swagger-ui/swagger-initializer.js
Normal file
@ -0,0 +1,20 @@
|
||||
window.onload = function() {
|
||||
//<editor-fold desc="Changeable Configuration Block">
|
||||
|
||||
// the following lines will be replaced by docker/configurator, when it runs in a docker-container
|
||||
window.ui = SwaggerUIBundle({
|
||||
url: "./swagger.yaml",
|
||||
dom_id: '#swagger-ui',
|
||||
deepLinking: true, displayOperationId: true, tryItOutEnabled: true,
|
||||
presets: [
|
||||
SwaggerUIBundle.presets.apis,
|
||||
SwaggerUIStandalonePreset
|
||||
],
|
||||
plugins: [
|
||||
SwaggerUIBundle.plugins.DownloadUrl
|
||||
],
|
||||
layout: "StandaloneLayout"
|
||||
});
|
||||
|
||||
//</editor-fold>
|
||||
};
|
3
server/combo/swagger-ui/swagger-ui-bundle.js
Normal file
3
server/combo/swagger-ui/swagger-ui-bundle.js
Normal file
File diff suppressed because one or more lines are too long
1
server/combo/swagger-ui/swagger-ui-bundle.js.map
Normal file
1
server/combo/swagger-ui/swagger-ui-bundle.js.map
Normal file
File diff suppressed because one or more lines are too long
3
server/combo/swagger-ui/swagger-ui-es-bundle-core.js
Normal file
3
server/combo/swagger-ui/swagger-ui-es-bundle-core.js
Normal file
File diff suppressed because one or more lines are too long
1
server/combo/swagger-ui/swagger-ui-es-bundle-core.js.map
Normal file
1
server/combo/swagger-ui/swagger-ui-es-bundle-core.js.map
Normal file
File diff suppressed because one or more lines are too long
3
server/combo/swagger-ui/swagger-ui-es-bundle.js
Normal file
3
server/combo/swagger-ui/swagger-ui-es-bundle.js
Normal file
File diff suppressed because one or more lines are too long
1
server/combo/swagger-ui/swagger-ui-es-bundle.js.map
Normal file
1
server/combo/swagger-ui/swagger-ui-es-bundle.js.map
Normal file
File diff suppressed because one or more lines are too long
3
server/combo/swagger-ui/swagger-ui-standalone-preset.js
Normal file
3
server/combo/swagger-ui/swagger-ui-standalone-preset.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
3
server/combo/swagger-ui/swagger-ui.css
Normal file
3
server/combo/swagger-ui/swagger-ui.css
Normal file
File diff suppressed because one or more lines are too long
1
server/combo/swagger-ui/swagger-ui.css.map
Normal file
1
server/combo/swagger-ui/swagger-ui.css.map
Normal file
File diff suppressed because one or more lines are too long
2
server/combo/swagger-ui/swagger-ui.js
Normal file
2
server/combo/swagger-ui/swagger-ui.js
Normal file
File diff suppressed because one or more lines are too long
1
server/combo/swagger-ui/swagger-ui.js.map
Normal file
1
server/combo/swagger-ui/swagger-ui.js.map
Normal file
File diff suppressed because one or more lines are too long
50
server/combo/swagger-ui/swagger.yaml
Normal file
50
server/combo/swagger-ui/swagger.yaml
Normal file
@ -0,0 +1,50 @@
|
||||
# Generated with protoc-gen-go-micro
|
||||
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Test API
|
||||
version: 0.0.1
|
||||
paths:
|
||||
/Call:
|
||||
post:
|
||||
tags:
|
||||
- Test
|
||||
operationId: Call
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CallReq'
|
||||
required: true
|
||||
responses:
|
||||
default:
|
||||
description: Default
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
"200":
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CallRsp'
|
||||
components:
|
||||
schemas:
|
||||
CallReq:
|
||||
type: object
|
||||
properties:
|
||||
req:
|
||||
type: string
|
||||
CallRsp:
|
||||
type: object
|
||||
properties:
|
||||
rsp:
|
||||
type: string
|
||||
Error:
|
||||
type: object
|
||||
properties:
|
||||
err:
|
||||
type: string
|
||||
tags:
|
||||
- name: Test
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-micro v3.10.1
|
||||
// - protoc-gen-go-micro v3.10.2
|
||||
// - protoc v3.21.12
|
||||
// source: test.proto
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// protoc-gen-go-micro version: v3.10.1
|
||||
// protoc-gen-go-micro version: v3.10.2
|
||||
// source: test.proto
|
||||
|
||||
package helloworld
|
||||
|
@ -8,10 +8,12 @@ import (
|
||||
"testing"
|
||||
|
||||
gclient "go.unistack.org/micro-client-grpc/v3"
|
||||
jsonpbcodec "go.unistack.org/micro-codec-jsonpb/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"
|
||||
health "go.unistack.org/micro-server-http/v3/handler/health"
|
||||
gpb "go.unistack.org/micro-tests/server/grpc/gproto"
|
||||
pb "go.unistack.org/micro-tests/server/grpc/proto"
|
||||
"go.unistack.org/micro/v3/broker"
|
||||
@ -23,7 +25,6 @@ import (
|
||||
"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"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
"google.golang.org/grpc/encoding/gzip"
|
||||
@ -105,7 +106,8 @@ func TestGRPCServer(t *testing.T) {
|
||||
|
||||
srv := httpsrv.NewServer(
|
||||
server.Address("127.0.0.1:0"),
|
||||
server.Codec("text/plain", codec.NewCodec()),
|
||||
server.Codec("application/json", jsonpbcodec.NewCodec()),
|
||||
server.Codec("text/plain", jsonpbcodec.NewCodec()),
|
||||
)
|
||||
if err = health.RegisterHealthServiceServer(srv, health.NewHandler(health.Version("0.0.1"))); err != nil {
|
||||
t.Fatalf("cant register health handler: %v", err)
|
||||
@ -137,11 +139,13 @@ func TestGRPCServer(t *testing.T) {
|
||||
}
|
||||
}()
|
||||
|
||||
hr, err := http.NewRequestWithContext(ctx, "GET", "http://"+srv.Options().Address+"/version", nil)
|
||||
t.Logf("get version info from http://" + srv.Options().Address + "/version")
|
||||
hr, err := http.NewRequestWithContext(ctx, http.MethodGet, "http://"+srv.Options().Address+"/version", nil)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
hr.Header.Set("Content-Type", "text/plain")
|
||||
|
||||
hr.Header.Set("Content-Type", "application/json")
|
||||
rsp, err := http.DefaultClient.Do(hr)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc v3.21.12
|
||||
// source: test.proto
|
||||
|
||||
@ -18,6 +18,10 @@ import (
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
Test_Call_FullMethodName = "/helloworld.Test/Call"
|
||||
)
|
||||
|
||||
// TestClient is the client API for Test service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
@ -35,7 +39,7 @@ func NewTestClient(cc grpc.ClientConnInterface) TestClient {
|
||||
|
||||
func (c *testClient) Call(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/helloworld.Test/Call", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, Test_Call_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -80,7 +84,7 @@ func _Test_Call_Handler(srv interface{}, ctx context.Context, dec func(interface
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/helloworld.Test/Call",
|
||||
FullMethod: Test_Call_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TestServer).Call(ctx, req.(*Request))
|
||||
|
@ -20,12 +20,12 @@ import (
|
||||
xmlcodec "go.unistack.org/micro-codec-xml/v3"
|
||||
vmeter "go.unistack.org/micro-meter-victoriametrics/v3"
|
||||
httpsrv "go.unistack.org/micro-server-http/v3"
|
||||
meterhandler "go.unistack.org/micro-server-http/v3/handler/meter"
|
||||
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"
|
||||
@ -375,7 +375,7 @@ func TestNativeClientServer(t *testing.T) {
|
||||
if err := pb.RegisterTestDoubleServer(srv, h); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := handler.RegisterMeterServiceServer(srv, handler.NewHandler(handler.Meter(srv.Options().Meter))); err != nil {
|
||||
if err := meterhandler.RegisterMeterServiceServer(srv, meterhandler.NewHandler(meterhandler.Meter(srv.Options().Meter))); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// start server
|
||||
|
Loading…
Reference in New Issue
Block a user