initial v4
Some checks failed
test / test (push) Failing after 1m53s

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2025-05-13 06:25:11 +03:00
parent 290f8a1f9a
commit f253aacfa1
73 changed files with 579 additions and 1534 deletions

View File

@@ -13,12 +13,12 @@ import (
"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"
// drpccli "go.unistack.org/micro-client-drpc/v4"
grpccli "go.unistack.org/micro-client-grpc/v4"
httpcli "go.unistack.org/micro-client-http/v4"
jsonpbcodec "go.unistack.org/micro-codec-jsonpb/v4"
protocodec "go.unistack.org/micro-codec-proto/v4"
httpsrv "go.unistack.org/micro-server-http/v4"
// 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"
@@ -26,12 +26,12 @@ import (
// 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"
"go.unistack.org/micro/v4/client"
"go.unistack.org/micro/v4/codec"
"go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v4/metadata"
"go.unistack.org/micro/v4/register"
"go.unistack.org/micro/v4/server"
"golang.org/x/net/http2"
"golang.org/x/net/http2/h2c"
"google.golang.org/grpc"

View File

@@ -10,20 +10,20 @@ import (
"strings"
"testing"
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"
grpccli "go.unistack.org/micro-client-grpc/v4"
httpcli "go.unistack.org/micro-client-http/v4"
jsonpbcodec "go.unistack.org/micro-codec-jsonpb/v4"
protocodec "go.unistack.org/micro-codec-proto/v4"
grpcsrv "go.unistack.org/micro-server-grpc/v4"
httpsrv "go.unistack.org/micro-server-http/v4"
mgpb "go.unistack.org/micro-tests/server/combo/mgpb"
mhpb "go.unistack.org/micro-tests/server/combo/mhpb"
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/logger"
mregister "go.unistack.org/micro/v3/register/memory"
"go.unistack.org/micro/v3/server"
"go.unistack.org/micro/v4/client"
"go.unistack.org/micro/v4/logger"
mregister "go.unistack.org/micro/v4/register/memory"
"go.unistack.org/micro/v4/server"
"golang.org/x/net/http2"
"golang.org/x/net/http2/h2c"
"google.golang.org/grpc"

View File

@@ -9,7 +9,7 @@ package pb
import (
context "context"
proto "go.unistack.org/micro-tests/server/combo/proto"
client "go.unistack.org/micro/v3/client"
client "go.unistack.org/micro/v4/client"
)
var (

View File

@@ -7,8 +7,8 @@ package pb
import (
context "context"
proto "go.unistack.org/micro-tests/server/combo/proto"
client "go.unistack.org/micro/v3/client"
server "go.unistack.org/micro/v3/server"
client "go.unistack.org/micro/v4/client"
server "go.unistack.org/micro/v4/server"
)
type testClient struct {

View File

@@ -9,7 +9,7 @@ package pb
import (
context "context"
proto "go.unistack.org/micro-tests/server/combo/proto"
client "go.unistack.org/micro/v3/client"
client "go.unistack.org/micro/v4/client"
)
var (

View File

@@ -6,11 +6,11 @@ package pb
import (
context "context"
v31 "go.unistack.org/micro-client-http/v3"
v3 "go.unistack.org/micro-server-http/v3"
v31 "go.unistack.org/micro-client-http/v4"
v3 "go.unistack.org/micro-server-http/v4"
proto "go.unistack.org/micro-tests/server/combo/proto"
client "go.unistack.org/micro/v3/client"
server "go.unistack.org/micro/v3/server"
client "go.unistack.org/micro/v4/client"
server "go.unistack.org/micro/v4/server"
http "net/http"
)

View File

@@ -8,7 +8,7 @@ package pb
import (
context "context"
client "go.unistack.org/micro/v3/client"
client "go.unistack.org/micro/v4/client"
)
var (

View File

@@ -9,8 +9,8 @@ package helloworld
import (
context "context"
proto "go.unistack.org/micro-tests/server/grpc/proto"
client "go.unistack.org/micro/v3/client"
metadata "go.unistack.org/micro/v3/metadata"
client "go.unistack.org/micro/v4/client"
metadata "go.unistack.org/micro/v4/metadata"
)
var (

View File

@@ -7,9 +7,9 @@ package helloworld
import (
context "context"
proto "go.unistack.org/micro-tests/server/grpc/proto"
client "go.unistack.org/micro/v3/client"
metadata "go.unistack.org/micro/v3/metadata"
server "go.unistack.org/micro/v3/server"
client "go.unistack.org/micro/v4/client"
metadata "go.unistack.org/micro/v4/metadata"
server "go.unistack.org/micro/v4/server"
)
type testClient struct {

View File

@@ -7,23 +7,23 @@ import (
"net/http"
"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"
gclient "go.unistack.org/micro-client-grpc/v4"
jsonpbcodec "go.unistack.org/micro-codec-jsonpb/v4"
protocodec "go.unistack.org/micro-codec-proto/v4"
regRouter "go.unistack.org/micro-router-register/v4"
gserver "go.unistack.org/micro-server-grpc/v4"
health "go.unistack.org/micro-server-http/v3/handler/health"
httpsrv "go.unistack.org/micro-server-http/v4"
gpb "go.unistack.org/micro-tests/server/grpc/gproto"
pb "go.unistack.org/micro-tests/server/grpc/proto"
"go.unistack.org/micro/v3/broker"
"go.unistack.org/micro/v3/client"
"go.unistack.org/micro/v3/errors"
"go.unistack.org/micro/v3/logger"
"go.unistack.org/micro/v3/metadata"
mregister "go.unistack.org/micro/v3/register/memory"
"go.unistack.org/micro/v3/router"
"go.unistack.org/micro/v3/server"
"go.unistack.org/micro/v4/broker"
"go.unistack.org/micro/v4/client"
"go.unistack.org/micro/v4/errors"
"go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v4/metadata"
mregister "go.unistack.org/micro/v4/register/memory"
"go.unistack.org/micro/v4/router"
"go.unistack.org/micro/v4/server"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/encoding/gzip"

View File

@@ -4,7 +4,7 @@ import (
"context"
"net/http"
httpsrv "go.unistack.org/micro-server-http/v3"
httpsrv "go.unistack.org/micro-server-http/v4"
pb "go.unistack.org/micro-tests/client/http/proto"
)

View File

@@ -15,19 +15,19 @@ import (
"sync"
"testing"
httpcli "go.unistack.org/micro-client-http/v3"
jsoncodec "go.unistack.org/micro-codec-json/v3"
jsonpbcodec "go.unistack.org/micro-codec-jsonpb/v3"
urlencodecodec "go.unistack.org/micro-codec-urlencode/v3"
xmlcodec "go.unistack.org/micro-codec-xml/v3"
vmeter "go.unistack.org/micro-meter-victoriametrics/v3"
httpsrv "go.unistack.org/micro-server-http/v3"
meterhandler "go.unistack.org/micro-server-http/v3/handler/meter"
httpcli "go.unistack.org/micro-client-http/v4"
jsoncodec "go.unistack.org/micro-codec-json/v4"
jsonpbcodec "go.unistack.org/micro-codec-jsonpb/v4"
urlencodecodec "go.unistack.org/micro-codec-urlencode/v4"
xmlcodec "go.unistack.org/micro-codec-xml/v4"
vmeter "go.unistack.org/micro-meter-victoriametrics/v4"
httpsrv "go.unistack.org/micro-server-http/v4"
meterhandler "go.unistack.org/micro-server-http/v4/handler/meter"
pb "go.unistack.org/micro-tests/server/http/proto"
"go.unistack.org/micro/v3/client"
"go.unistack.org/micro/v3/metadata"
mregister "go.unistack.org/micro/v3/register/memory"
"go.unistack.org/micro/v3/server"
"go.unistack.org/micro/v4/client"
"go.unistack.org/micro/v4/metadata"
mregister "go.unistack.org/micro/v4/register/memory"
"go.unistack.org/micro/v4/server"
wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
)
@@ -146,14 +146,14 @@ func NewServerHandlerWrapper(t *testing.T) server.HookHandler {
if !ok {
return errors.New("missing metadata")
}
if v, ok := imd.Get("Authorization"); ok && v == "test" {
if v, ok := imd.GetJoined("Authorization"); ok && v == "test" {
nmd.Set("my-key", "my-val")
nmd.Set("Content-Type", "text/xml")
httpsrv.SetRspCode(ctx, http.StatusUnauthorized)
return httpsrv.SetError(&pb.CallRsp{Rsp: "name_my_name"})
}
if v, ok := imd.Get("Test-Content-Type"); ok && v != "" {
if v, ok := imd.GetJoined("Test-Content-Type"); ok && v != "" {
nmd.Set("my-key", "my-val")
nmd.Set("Content-Type", v)
}
@@ -208,7 +208,7 @@ func (h *Handler) Call(ctx context.Context, req *pb.CallReq, rsp *pb.CallRsp) er
if req.Name != "my_name" {
h.t.Fatalf("invalid req received: %#+v", req)
}
if v, ok := md.Get("Authorization"); ok && v == "test" {
if v, ok := md.GetJoined("Authorization"); ok && v == "test" {
rsp.Rsp = "name_my_name"
httpsrv.SetRspCode(ctx, http.StatusUnauthorized)
omd.Set("my-key", "my-val")

View File

@@ -8,7 +8,7 @@ package pb
import (
context "context"
client "go.unistack.org/micro/v3/client"
client "go.unistack.org/micro/v4/client"
)
var (

View File

@@ -6,10 +6,10 @@ package pb
import (
context "context"
v31 "go.unistack.org/micro-client-http/v3"
v3 "go.unistack.org/micro-server-http/v3"
client "go.unistack.org/micro/v3/client"
server "go.unistack.org/micro/v3/server"
v31 "go.unistack.org/micro-client-http/v4"
v3 "go.unistack.org/micro-server-http/v4"
client "go.unistack.org/micro/v4/client"
server "go.unistack.org/micro/v4/server"
http "net/http"
time "time"
)

View File

@@ -8,10 +8,10 @@ import (
"testing"
"time"
tcp "go.unistack.org/micro-server-tcp/v3"
"go.unistack.org/micro/v3/broker"
mregister "go.unistack.org/micro/v3/register/memory"
"go.unistack.org/micro/v3/server"
tcp "go.unistack.org/micro-server-tcp/v4"
"go.unistack.org/micro/v4/broker"
mregister "go.unistack.org/micro/v4/register/memory"
"go.unistack.org/micro/v4/server"
)
type testHandler struct {