Skip to content

Commit

Permalink
modify for v5
Browse files Browse the repository at this point in the history
  • Loading branch information
smallnest committed Apr 28, 2020
1 parent c13fa98 commit d9d3faf
Show file tree
Hide file tree
Showing 50 changed files with 84 additions and 84 deletions.
6 changes: 3 additions & 3 deletions client/client.go
Expand Up @@ -15,9 +15,9 @@ import (

opentracing "github.com/opentracing/opentracing-go"
circuit "github.com/rubyist/circuitbreaker"
"github.com/smallnest/rpcx/log"
"github.com/smallnest/rpcx/protocol"
"github.com/smallnest/rpcx/share"
"github.com/smallnest/rpcx/v5/log"
"github.com/smallnest/rpcx/v5/protocol"
"github.com/smallnest/rpcx/v5/share"
"go.opencensus.io/trace"
)

Expand Down
6 changes: 3 additions & 3 deletions client/client_test.go
Expand Up @@ -7,9 +7,9 @@ import (
"testing"
"time"

testutils "github.com/smallnest/rpcx/_testutils"
"github.com/smallnest/rpcx/protocol"
"github.com/smallnest/rpcx/server"
testutils "github.com/smallnest/rpcx/v5/_testutils"
"github.com/smallnest/rpcx/v5/protocol"
"github.com/smallnest/rpcx/v5/server"
)

type Args struct {
Expand Down
4 changes: 2 additions & 2 deletions client/connection.go
Expand Up @@ -9,8 +9,8 @@ import (
"net/http"
"time"

"github.com/smallnest/rpcx/log"
"github.com/smallnest/rpcx/share"
"github.com/smallnest/rpcx/v5/log"
"github.com/smallnest/rpcx/v5/share"
)

type ConnFactoryFn func(c *Client, network, address string) (net.Conn, error)
Expand Down
2 changes: 1 addition & 1 deletion client/consul_discovery.go
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/docker/libkv"
"github.com/docker/libkv/store"
"github.com/docker/libkv/store/consul"
"github.com/smallnest/rpcx/log"
"github.com/smallnest/rpcx/v5/log"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion client/etcd_discovery.go
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/docker/libkv"
"github.com/docker/libkv/store"
"github.com/docker/libkv/store/etcd"
"github.com/smallnest/rpcx/log"
"github.com/smallnest/rpcx/v5/log"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion client/etcdv3_discovery.go
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/docker/libkv"
"github.com/docker/libkv/store"
etcd "github.com/smallnest/libkv-etcdv3-store"
"github.com/smallnest/rpcx/log"
"github.com/smallnest/rpcx/v5/log"
)

func init() {
Expand Down
6 changes: 3 additions & 3 deletions client/inprocess_client.go
Expand Up @@ -7,9 +7,9 @@ import (
"reflect"
"sync"

"github.com/smallnest/rpcx/log"
"github.com/smallnest/rpcx/protocol"
"github.com/smallnest/rpcx/share"
"github.com/smallnest/rpcx/v5/log"
"github.com/smallnest/rpcx/v5/protocol"
"github.com/smallnest/rpcx/v5/share"
)

// InprocessClient is a in-process client for test.
Expand Down
2 changes: 1 addition & 1 deletion client/mdns_discovery.go
Expand Up @@ -8,7 +8,7 @@ import (
"time"

"github.com/grandcat/zeroconf"
"github.com/smallnest/rpcx/log"
"github.com/smallnest/rpcx/v5/log"
)

type serviceMeta struct {
Expand Down
2 changes: 1 addition & 1 deletion client/multiple_servers_discovery.go
Expand Up @@ -4,7 +4,7 @@ import (
"sync"
"time"

"github.com/smallnest/rpcx/log"
"github.com/smallnest/rpcx/v5/log"
)

// MultipleServersDiscovery is a multiple servers service discovery.
Expand Down
4 changes: 2 additions & 2 deletions client/nacos_discovery.go
Expand Up @@ -10,8 +10,8 @@ import (
"github.com/nacos-group/nacos-sdk-go/common/constant"
"github.com/nacos-group/nacos-sdk-go/model"
"github.com/nacos-group/nacos-sdk-go/vo"
"github.com/smallnest/rpcx/log"
"github.com/smallnest/rpcx/util"
"github.com/smallnest/rpcx/v5/log"
"github.com/smallnest/rpcx/v5/util"
)

// NacosDiscovery is a nacos service discovery.
Expand Down
4 changes: 2 additions & 2 deletions client/oneclient.go
Expand Up @@ -6,10 +6,10 @@ import (
"io"
"sync"

"github.com/smallnest/rpcx/serverplugin"
"github.com/smallnest/rpcx/v5/serverplugin"

multierror "github.com/hashicorp/go-multierror"
"github.com/smallnest/rpcx/protocol"
"github.com/smallnest/rpcx/v5/protocol"
)

// OneClient wraps servicesPath and XClients.
Expand Down
2 changes: 1 addition & 1 deletion client/oneclient_pool.go
Expand Up @@ -3,7 +3,7 @@ package client
import (
"sync/atomic"

"github.com/smallnest/rpcx/protocol"
"github.com/smallnest/rpcx/v5/protocol"
)

// OneClientPool is a oneclient pool with fixed size.
Expand Down
2 changes: 1 addition & 1 deletion client/opencensus.go
Expand Up @@ -3,7 +3,7 @@ package client
import (
"context"

"github.com/smallnest/rpcx/share"
"github.com/smallnest/rpcx/v5/share"
"go.opencensus.io/trace"
)

Expand Down
2 changes: 1 addition & 1 deletion client/opentracing.go
Expand Up @@ -5,7 +5,7 @@ import (

opentracing "github.com/opentracing/opentracing-go"
"github.com/opentracing/opentracing-go/ext"
"github.com/smallnest/rpcx/share"
"github.com/smallnest/rpcx/v5/share"
)

type OpenTracingPlugin struct{}
Expand Down
2 changes: 1 addition & 1 deletion client/plugin.go
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"net"

"github.com/smallnest/rpcx/protocol"
"github.com/smallnest/rpcx/v5/protocol"
)

// pluginContainer implements PluginContainer interface.
Expand Down
2 changes: 1 addition & 1 deletion client/redis_discovery.go
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/abronan/valkeyrie"
"github.com/abronan/valkeyrie/store"
"github.com/smallnest/rpcx/log"
"github.com/smallnest/rpcx/v5/log"
"github.com/smallnest/valkeyrie/store/redis"
)

Expand Down
8 changes: 4 additions & 4 deletions client/xclient.go
Expand Up @@ -14,10 +14,10 @@ import (
"time"

"github.com/juju/ratelimit"
ex "github.com/smallnest/rpcx/errors"
"github.com/smallnest/rpcx/protocol"
"github.com/smallnest/rpcx/serverplugin"
"github.com/smallnest/rpcx/share"
ex "github.com/smallnest/rpcx/v5/errors"
"github.com/smallnest/rpcx/v5/protocol"
"github.com/smallnest/rpcx/v5/serverplugin"
"github.com/smallnest/rpcx/v5/share"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion client/xclient_pool.go
Expand Up @@ -3,7 +3,7 @@ package client
import (
"sync/atomic"

"github.com/smallnest/rpcx/protocol"
"github.com/smallnest/rpcx/v5/protocol"
)

// XClientPool is a xclient pool with fixed size.
Expand Down
8 changes: 4 additions & 4 deletions client/xclient_test.go
Expand Up @@ -8,10 +8,10 @@ import (

"fmt"

testutils "github.com/smallnest/rpcx/_testutils"
"github.com/smallnest/rpcx/protocol"
"github.com/smallnest/rpcx/server"
"github.com/smallnest/rpcx/share"
testutils "github.com/smallnest/rpcx/v5/_testutils"
"github.com/smallnest/rpcx/v5/protocol"
"github.com/smallnest/rpcx/v5/server"
"github.com/smallnest/rpcx/v5/share"
)

func TestXClient_Thrift(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion client/zookeeper_discovery.go
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/docker/libkv"
"github.com/docker/libkv/store"
"github.com/docker/libkv/store/zookeeper"
"github.com/smallnest/rpcx/log"
"github.com/smallnest/rpcx/v5/log"
)

func init() {
Expand Down
3 changes: 1 addition & 2 deletions go.mod
@@ -1,4 +1,4 @@
module github.com/smallnest/rpcx
module github.com/smallnest/rpcx/v5

go 1.13

Expand Down Expand Up @@ -47,7 +47,6 @@ require (
github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da // indirect
github.com/satori/go.uuid v1.2.0 // indirect
github.com/smallnest/libkv-etcdv3-store v1.1.1
github.com/smallnest/rpcx/v5 v5.3.0
github.com/smallnest/valkeyrie v0.0.0-20191030065038-13edeca3d026
github.com/soheilhy/cmux v0.1.4
github.com/tatsushid/go-fastping v0.0.0-20160109021039-d7bb493dee3e
Expand Down
3 changes: 2 additions & 1 deletion go.sum
Expand Up @@ -327,7 +327,8 @@ github.com/sirupsen/logrus v1.2.0 h1:juTguoYk5qI21pwyTXY3B3Y5cOTH3ZUyZCg1v/mihuo
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/smallnest/libkv-etcdv3-store v1.1.1 h1:Y5qRz0xgFuNLv6Cc4L6yxO5rst2BSklYxKD00Ir3XmA=
github.com/smallnest/libkv-etcdv3-store v1.1.1/go.mod h1:VAzE2+HQwhZZanve7ObW+IFWdK0WMVoQhxmyuvLCfog=
github.com/smallnest/rpcx/v5 v5.3.0 h1:Ubh937UYV5S2FXOz/o63RfzX/Q0KmSmJT4vq6jxxXk8=
github.com/smallnest/rpcx v0.0.0-20200428102033-c13fa98bc4ff h1:Tsk5IfmjeoWh2QcXf1DZaSP5kiBhRIFpuDb8YwrgoNg=
github.com/smallnest/rpcx v0.0.0-20200428102033-c13fa98bc4ff/go.mod h1:/jERLfHN4rxXQNtkUIjz07a7y3LJXvD8pPz9inZ/mVI=
github.com/smallnest/rpcx/v5 v5.3.0/go.mod h1:009obAQxGzBJGwYJZpkBZA+xSghQO2/sgyO9Edb3C9E=
github.com/smallnest/valkeyrie v0.0.0-20191030065038-13edeca3d026 h1:2JZDSZUojMiRtgWzSyO7lZSxCKfTsItI2ilEGTBuSNc=
github.com/smallnest/valkeyrie v0.0.0-20191030065038-13edeca3d026/go.mod h1:ixoXqhXnCjUFM17O2cOVoJ98KzDnCb2+iGtJDmtC/qs=
Expand Down
2 changes: 1 addition & 1 deletion protocol/compressor.go
@@ -1,7 +1,7 @@
package protocol

import (
"github.com/smallnest/rpcx/util"
"github.com/smallnest/rpcx/v5/util"
)

// Compressor defines a common compression interface.
Expand Down
2 changes: 1 addition & 1 deletion protocol/message.go
Expand Up @@ -7,7 +7,7 @@ import (
"fmt"
"io"

"github.com/smallnest/rpcx/util"
"github.com/smallnest/rpcx/v5/util"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion reflection/server_reflection.go
Expand Up @@ -13,7 +13,7 @@ import (

"github.com/ChimeraCoder/gojson"
jsoniter "github.com/json-iterator/go"
"github.com/smallnest/rpcx/log"
"github.com/smallnest/rpcx/v5/log"
)

var typeOfError = reflect.TypeOf((*error)(nil)).Elem()
Expand Down
2 changes: 1 addition & 1 deletion reflection/server_reflection_test.go
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/kr/pretty"

testutils "github.com/smallnest/rpcx/_testutils"
testutils "github.com/smallnest/rpcx/v5/_testutils"
)

type PBArith int
Expand Down
4 changes: 2 additions & 2 deletions server/converter.go
Expand Up @@ -6,8 +6,8 @@ import (
"net/url"
"strconv"

"github.com/smallnest/rpcx/protocol"
"github.com/smallnest/rpcx/share"
"github.com/smallnest/rpcx/v5/protocol"
"github.com/smallnest/rpcx/v5/share"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions server/gateway.go
Expand Up @@ -12,9 +12,9 @@ import (

"github.com/julienschmidt/httprouter"
"github.com/rs/cors"
"github.com/smallnest/rpcx/log"
"github.com/smallnest/rpcx/protocol"
"github.com/smallnest/rpcx/share"
"github.com/smallnest/rpcx/v5/log"
"github.com/smallnest/rpcx/v5/protocol"
"github.com/smallnest/rpcx/v5/share"
"github.com/soheilhy/cmux"
)

Expand Down
4 changes: 2 additions & 2 deletions server/jsonrpc2.go
Expand Up @@ -10,8 +10,8 @@ import (
"strings"

"github.com/rs/cors"
"github.com/smallnest/rpcx/protocol"
"github.com/smallnest/rpcx/share"
"github.com/smallnest/rpcx/v5/protocol"
"github.com/smallnest/rpcx/v5/share"
)

func (s *Server) jsonrpcHandler(w http.ResponseWriter, r *http.Request) {
Expand Down
4 changes: 2 additions & 2 deletions server/plugin.go
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"net"

"github.com/smallnest/rpcx/errors"
"github.com/smallnest/rpcx/protocol"
"github.com/smallnest/rpcx/v5/errors"
"github.com/smallnest/rpcx/v5/protocol"
)

//PluginContainer represents a plugin container that defines all methods to manage plugins.
Expand Down
6 changes: 3 additions & 3 deletions server/server.go
Expand Up @@ -21,9 +21,9 @@ import (
"os/signal"
"syscall"

"github.com/smallnest/rpcx/log"
"github.com/smallnest/rpcx/protocol"
"github.com/smallnest/rpcx/share"
"github.com/smallnest/rpcx/v5/log"
"github.com/smallnest/rpcx/v5/protocol"
"github.com/smallnest/rpcx/v5/share"
)

// ErrServerClosed is returned by the Server's Serve, ListenAndServe after a call to Shutdown or Close.
Expand Down
6 changes: 3 additions & 3 deletions server/server_test.go
Expand Up @@ -7,9 +7,9 @@ import (

"time"

testutils "github.com/smallnest/rpcx/_testutils"
"github.com/smallnest/rpcx/protocol"
"github.com/smallnest/rpcx/share"
testutils "github.com/smallnest/rpcx/v5/_testutils"
"github.com/smallnest/rpcx/v5/protocol"
"github.com/smallnest/rpcx/v5/share"
)

type Args struct {
Expand Down
4 changes: 2 additions & 2 deletions server/service.go
Expand Up @@ -11,8 +11,8 @@ import (
"unicode"
"unicode/utf8"

rerrors "github.com/smallnest/rpcx/errors"
"github.com/smallnest/rpcx/log"
rerrors "github.com/smallnest/rpcx/v5/errors"
"github.com/smallnest/rpcx/v5/log"
)

// Precompute the reflect type for error. Can't use error directly
Expand Down
2 changes: 1 addition & 1 deletion serverplugin/alias.go
Expand Up @@ -3,7 +3,7 @@ package serverplugin
import (
"context"

"github.com/smallnest/rpcx/protocol"
"github.com/smallnest/rpcx/v5/protocol"
)

var aliasAppliedKey = "__aliasAppliedKey"
Expand Down
2 changes: 1 addition & 1 deletion serverplugin/consul.go
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/docker/libkv/store"
"github.com/docker/libkv/store/consul"
metrics "github.com/rcrowley/go-metrics"
"github.com/smallnest/rpcx/log"
"github.com/smallnest/rpcx/v5/log"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion serverplugin/consul_test.go
Expand Up @@ -5,7 +5,7 @@ import (
"time"

metrics "github.com/rcrowley/go-metrics"
"github.com/smallnest/rpcx/server"
"github.com/smallnest/rpcx/v5/server"
)

func TestConsulRegistry(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion serverplugin/etcd.go
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/docker/libkv/store"
"github.com/docker/libkv/store/etcd"
metrics "github.com/rcrowley/go-metrics"
"github.com/smallnest/rpcx/log"
"github.com/smallnest/rpcx/v5/log"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion serverplugin/etcd_test.go
Expand Up @@ -5,7 +5,7 @@ import (
"time"

metrics "github.com/rcrowley/go-metrics"
"github.com/smallnest/rpcx/server"
"github.com/smallnest/rpcx/v5/server"
)

func TestEtcdRegistry(t *testing.T) {
Expand Down

0 comments on commit d9d3faf

Please sign in to comment.