Skip to content

Commit

Permalink
Rearrange packages of go-micro adapter and test cases (#219)
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Zhao <[email protected]>
  • Loading branch information
sczyh30 authored Sep 1, 2020
1 parent a28b746 commit 5595860
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 33 deletions.
2 changes: 1 addition & 1 deletion adapter/go_micro/client.go → adapter/micro/client.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package go_micro
package micro

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package go_micro
package micro

import (
"context"
"errors"
"log"
"testing"

"github.com/alibaba/sentinel-golang/adapter/go_micro/proto"
sentinel "github.com/alibaba/sentinel-golang/api"
"github.com/alibaba/sentinel-golang/core/base"
"github.com/alibaba/sentinel-golang/core/flow"
"github.com/alibaba/sentinel-golang/core/stat"
"github.com/alibaba/sentinel-golang/tests/adapter/micro/proto"
"github.com/micro/go-micro/v2/client"
"github.com/micro/go-micro/v2/client/selector"
"github.com/micro/go-micro/v2/registry/memory"
Expand Down
2 changes: 1 addition & 1 deletion adapter/go_micro/options.go → adapter/micro/options.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package go_micro
package micro

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion adapter/go_micro/server.go → adapter/micro/server.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package go_micro
package micro

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package go_micro
package micro

import (
"context"
Expand All @@ -7,11 +7,11 @@ import (
"testing"
"time"

"github.com/alibaba/sentinel-golang/adapter/go_micro/proto"
sentinel "github.com/alibaba/sentinel-golang/api"
"github.com/alibaba/sentinel-golang/core/base"
"github.com/alibaba/sentinel-golang/core/flow"
"github.com/alibaba/sentinel-golang/core/stat"
"github.com/alibaba/sentinel-golang/tests/adapter/micro/proto"
"github.com/micro/go-micro/v2"
"github.com/micro/go-micro/v2/server"
"github.com/stretchr/testify/assert"
Expand All @@ -29,6 +29,7 @@ func (h *TestHandler) Ping(ctx context.Context, req *proto.Request, rsp *proto.R
func TestServerLimiter(t *testing.T) {

svr := micro.NewService(
micro.Address("localhost:56436"),
micro.Name("sentinel.test.server"),
micro.Version("latest"),
micro.WrapHandler(NewHandlerWrapper(
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.13
require (
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
github.com/apache/dubbo-go v1.4.2
github.com/coreos/etcd v3.3.13+incompatible
github.com/coreos/etcd v3.3.18+incompatible
github.com/fsnotify/fsnotify v1.4.7
github.com/gin-gonic/gin v1.5.0
github.com/go-ole/go-ole v1.2.4 // indirect
Expand All @@ -20,6 +20,6 @@ require (
github.com/stretchr/testify v1.5.1
go.uber.org/multierr v1.5.0
golang.org/x/tools v0.0.0-20200426102838-f3a5411a4c3b // indirect
google.golang.org/grpc v1.22.1
google.golang.org/grpc v1.26.0
gopkg.in/yaml.v2 v2.2.8
)
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ github.com/coreos/bbolt v1.3.3 h1:n6AiVyVRKQFNb6mJlwESEvvLoDyiTzXX7ORAUlkeBdY=
github.com/coreos/bbolt v1.3.3/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
github.com/coreos/etcd v3.3.13+incompatible h1:8F3hqu9fGYLBifCmRCJsicFqDx/D68Rt3q1JMazcgBQ=
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/etcd v3.3.18+incompatible h1:Zz1aXgDrFFi1nadh58tA9ktt06cmPTwNNP3dXwIq1lE=
github.com/coreos/etcd v3.3.18+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
Expand Down Expand Up @@ -923,6 +925,8 @@ google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac
google.golang.org/grpc v1.22.1 h1:/7cs52RnTJmD43s3uxzlq2U7nqVTd/37viQwMrMNlOM=
google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.26.0 h1:2dTRdpdFEEhJYQD8EMLB61nnrzSCTbG38PhqdhvOltg=
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
syntax = "proto3";
package proto;
option go_package = "adapter/go_micro/proto;proto";
option go_package = "tests/adapter/micro/proto;proto";

service Test {
rpc Ping(Request) returns (Response) {}
Expand Down

0 comments on commit 5595860

Please sign in to comment.