Skip to content

Commit 5595860

Browse files
authored
Rearrange packages of go-micro adapter and test cases (alibaba#219)
Signed-off-by: Eric Zhao <[email protected]>
1 parent a28b746 commit 5595860

File tree

10 files changed

+36
-33
lines changed

10 files changed

+36
-33
lines changed

adapter/go_micro/client.go adapter/micro/client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package go_micro
1+
package micro
22

33
import (
44
"context"

adapter/go_micro/client_test.go adapter/micro/client_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
package go_micro
1+
package micro
22

33
import (
44
"context"
55
"errors"
66
"log"
77
"testing"
88

9-
"github.com/alibaba/sentinel-golang/adapter/go_micro/proto"
109
sentinel "github.com/alibaba/sentinel-golang/api"
1110
"github.com/alibaba/sentinel-golang/core/base"
1211
"github.com/alibaba/sentinel-golang/core/flow"
1312
"github.com/alibaba/sentinel-golang/core/stat"
13+
"github.com/alibaba/sentinel-golang/tests/adapter/micro/proto"
1414
"github.com/micro/go-micro/v2/client"
1515
"github.com/micro/go-micro/v2/client/selector"
1616
"github.com/micro/go-micro/v2/registry/memory"

adapter/go_micro/options.go adapter/micro/options.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package go_micro
1+
package micro
22

33
import (
44
"context"

adapter/go_micro/server.go adapter/micro/server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package go_micro
1+
package micro
22

33
import (
44
"context"

adapter/go_micro/server_test.go adapter/micro/server_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package go_micro
1+
package micro
22

33
import (
44
"context"
@@ -7,11 +7,11 @@ import (
77
"testing"
88
"time"
99

10-
"github.com/alibaba/sentinel-golang/adapter/go_micro/proto"
1110
sentinel "github.com/alibaba/sentinel-golang/api"
1211
"github.com/alibaba/sentinel-golang/core/base"
1312
"github.com/alibaba/sentinel-golang/core/flow"
1413
"github.com/alibaba/sentinel-golang/core/stat"
14+
"github.com/alibaba/sentinel-golang/tests/adapter/micro/proto"
1515
"github.com/micro/go-micro/v2"
1616
"github.com/micro/go-micro/v2/server"
1717
"github.com/stretchr/testify/assert"
@@ -29,6 +29,7 @@ func (h *TestHandler) Ping(ctx context.Context, req *proto.Request, rsp *proto.R
2929
func TestServerLimiter(t *testing.T) {
3030

3131
svr := micro.NewService(
32+
micro.Address("localhost:56436"),
3233
micro.Name("sentinel.test.server"),
3334
micro.Version("latest"),
3435
micro.WrapHandler(NewHandlerWrapper(

go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.13
55
require (
66
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
77
github.com/apache/dubbo-go v1.4.2
8-
github.com/coreos/etcd v3.3.13+incompatible
8+
github.com/coreos/etcd v3.3.18+incompatible
99
github.com/fsnotify/fsnotify v1.4.7
1010
github.com/gin-gonic/gin v1.5.0
1111
github.com/go-ole/go-ole v1.2.4 // indirect
@@ -20,6 +20,6 @@ require (
2020
github.com/stretchr/testify v1.5.1
2121
go.uber.org/multierr v1.5.0
2222
golang.org/x/tools v0.0.0-20200426102838-f3a5411a4c3b // indirect
23-
google.golang.org/grpc v1.22.1
23+
google.golang.org/grpc v1.26.0
2424
gopkg.in/yaml.v2 v2.2.8
2525
)

go.sum

+4
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ github.com/coreos/bbolt v1.3.3 h1:n6AiVyVRKQFNb6mJlwESEvvLoDyiTzXX7ORAUlkeBdY=
117117
github.com/coreos/bbolt v1.3.3/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
118118
github.com/coreos/etcd v3.3.13+incompatible h1:8F3hqu9fGYLBifCmRCJsicFqDx/D68Rt3q1JMazcgBQ=
119119
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
120+
github.com/coreos/etcd v3.3.18+incompatible h1:Zz1aXgDrFFi1nadh58tA9ktt06cmPTwNNP3dXwIq1lE=
121+
github.com/coreos/etcd v3.3.18+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
120122
github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=
121123
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
122124
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
@@ -923,6 +925,8 @@ google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac
923925
google.golang.org/grpc v1.22.1 h1:/7cs52RnTJmD43s3uxzlq2U7nqVTd/37viQwMrMNlOM=
924926
google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
925927
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
928+
google.golang.org/grpc v1.26.0 h1:2dTRdpdFEEhJYQD8EMLB61nnrzSCTbG38PhqdhvOltg=
929+
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
926930
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
927931
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
928932
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=

adapter/go_micro/proto/test.pb.go tests/adapter/micro/proto/test.pb.go

+19-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

adapter/go_micro/proto/test.pb.micro.go tests/adapter/micro/proto/test.pb.micro.go

+2-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

adapter/go_micro/proto/test.proto tests/adapter/micro/proto/test.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
syntax = "proto3";
22
package proto;
3-
option go_package = "adapter/go_micro/proto;proto";
3+
option go_package = "tests/adapter/micro/proto;proto";
44

55
service Test {
66
rpc Ping(Request) returns (Response) {}

0 commit comments

Comments
 (0)