Skip to content
Snippets Groups Projects
Commit f231b435 authored by vito.he's avatar vito.he
Browse files

Add:2.6.0 import format

parent 5de3b9a4
No related branches found
No related tags found
No related merge requests found
Showing with 34 additions and 22 deletions
...@@ -3,7 +3,6 @@ package directory ...@@ -3,7 +3,6 @@ package directory
import ( import (
"context" "context"
"fmt" "fmt"
"strings" "strings"
"time" "time"
) )
......
package cluster package cluster
import (
"time"
)
import ( import (
"github.com/dubbo/dubbo-go/common/constant" "github.com/dubbo/dubbo-go/common/constant"
"github.com/dubbo/dubbo-go/config" "github.com/dubbo/dubbo-go/config"
"github.com/dubbo/dubbo-go/protocol" "github.com/dubbo/dubbo-go/protocol"
"time"
) )
// Extension - LoadBalance // Extension - LoadBalance
......
package loadbalance package loadbalance
import (
"math/rand"
)
import ( import (
"github.com/dubbo/dubbo-go/cluster" "github.com/dubbo/dubbo-go/cluster"
"github.com/dubbo/dubbo-go/common/extension" "github.com/dubbo/dubbo-go/common/extension"
"github.com/dubbo/dubbo-go/config" "github.com/dubbo/dubbo-go/config"
"github.com/dubbo/dubbo-go/protocol" "github.com/dubbo/dubbo-go/protocol"
"math/rand"
) )
const name = "random" const name = "random"
......
...@@ -2,7 +2,6 @@ package cluster ...@@ -2,7 +2,6 @@ package cluster
import ( import (
gxnet "github.com/AlexStocks/goext/net" gxnet "github.com/AlexStocks/goext/net"
"github.com/dubbo/dubbo-go/version"
jerrors "github.com/juju/errors" jerrors "github.com/juju/errors"
"github.com/tevino/abool" "github.com/tevino/abool"
) )
...@@ -11,6 +10,7 @@ import ( ...@@ -11,6 +10,7 @@ import (
"github.com/dubbo/dubbo-go/cluster" "github.com/dubbo/dubbo-go/cluster"
"github.com/dubbo/dubbo-go/config" "github.com/dubbo/dubbo-go/config"
"github.com/dubbo/dubbo-go/protocol" "github.com/dubbo/dubbo-go/protocol"
"github.com/dubbo/dubbo-go/version"
) )
type baseClusterInvoker struct { type baseClusterInvoker struct {
......
...@@ -2,6 +2,9 @@ package cluster ...@@ -2,6 +2,9 @@ package cluster
import ( import (
"context" "context"
)
import (
"github.com/dubbo/dubbo-go/cluster" "github.com/dubbo/dubbo-go/cluster"
"github.com/dubbo/dubbo-go/common/extension" "github.com/dubbo/dubbo-go/common/extension"
"github.com/dubbo/dubbo-go/protocol" "github.com/dubbo/dubbo-go/protocol"
...@@ -22,5 +25,5 @@ func NewFailoverCluster() cluster.Cluster { ...@@ -22,5 +25,5 @@ func NewFailoverCluster() cluster.Cluster {
} }
func (cluster *FailoverCluster) Join(directory cluster.Directory) protocol.Invoker { func (cluster *FailoverCluster) Join(directory cluster.Directory) protocol.Invoker {
return NewFailoverClusterInvoker( directory) return NewFailoverClusterInvoker(directory)
} }
...@@ -2,13 +2,15 @@ package cluster ...@@ -2,13 +2,15 @@ package cluster
import ( import (
gxnet "github.com/AlexStocks/goext/net" gxnet "github.com/AlexStocks/goext/net"
jerrors "github.com/juju/errors"
)
import (
"github.com/dubbo/dubbo-go/cluster" "github.com/dubbo/dubbo-go/cluster"
"github.com/dubbo/dubbo-go/common/constant" "github.com/dubbo/dubbo-go/common/constant"
"github.com/dubbo/dubbo-go/common/extension" "github.com/dubbo/dubbo-go/common/extension"
"github.com/dubbo/dubbo-go/config" "github.com/dubbo/dubbo-go/config"
"github.com/dubbo/dubbo-go/protocol" "github.com/dubbo/dubbo-go/protocol"
"github.com/dubbo/dubbo-go/version" "github.com/dubbo/dubbo-go/version"
jerrors "github.com/juju/errors"
) )
type failoverClusterInvoker struct { type failoverClusterInvoker struct {
......
...@@ -2,7 +2,6 @@ package support ...@@ -2,7 +2,6 @@ package support
import ( import (
"fmt" "fmt"
"gopkg.in/yaml.v2"
"io/ioutil" "io/ioutil"
"os" "os"
"path" "path"
...@@ -12,6 +11,7 @@ import ( ...@@ -12,6 +11,7 @@ import (
import ( import (
"github.com/AlexStocks/goext/log" "github.com/AlexStocks/goext/log"
jerrors "github.com/juju/errors" jerrors "github.com/juju/errors"
"gopkg.in/yaml.v2"
) )
import ( import (
......
...@@ -2,8 +2,6 @@ package support ...@@ -2,8 +2,6 @@ package support
import ( import (
"context" "context"
"github.com/dubbo/dubbo-go/config"
"github.com/dubbo/dubbo-go/protocol"
) )
import ( import (
...@@ -12,6 +10,8 @@ import ( ...@@ -12,6 +10,8 @@ import (
import ( import (
"github.com/dubbo/dubbo-go/common/extension" "github.com/dubbo/dubbo-go/common/extension"
"github.com/dubbo/dubbo-go/config"
"github.com/dubbo/dubbo-go/protocol"
) )
var refprotocol = extension.GetProtocolExtension("registry") var refprotocol = extension.GetProtocolExtension("registry")
......
package directory package directory
import ( import (
"github.com/dubbo/dubbo-go/common/constant"
"github.com/dubbo/dubbo-go/protocol/protocolwrapper"
"github.com/dubbo/dubbo-go/registry"
protocol2 "github.com/dubbo/dubbo-go/registry/protocol"
"sync" "sync"
"time" "time"
) )
...@@ -16,9 +12,13 @@ import ( ...@@ -16,9 +12,13 @@ import (
import ( import (
"github.com/dubbo/dubbo-go/cluster/directory" "github.com/dubbo/dubbo-go/cluster/directory"
"github.com/dubbo/dubbo-go/common/constant"
"github.com/dubbo/dubbo-go/common/extension" "github.com/dubbo/dubbo-go/common/extension"
"github.com/dubbo/dubbo-go/config" "github.com/dubbo/dubbo-go/config"
"github.com/dubbo/dubbo-go/protocol" "github.com/dubbo/dubbo-go/protocol"
"github.com/dubbo/dubbo-go/protocol/protocolwrapper"
"github.com/dubbo/dubbo-go/registry"
protocol2 "github.com/dubbo/dubbo-go/registry/protocol"
) )
type Options struct { type Options struct {
......
...@@ -2,10 +2,12 @@ package registry ...@@ -2,10 +2,12 @@ package registry
import ( import (
"fmt" "fmt"
"github.com/dubbo/dubbo-go/config"
"math/rand" "math/rand"
"time" "time"
) )
import (
"github.com/dubbo/dubbo-go/config"
)
func init() { func init() {
rand.Seed(time.Now().UnixNano()) rand.Seed(time.Now().UnixNano())
......
package protocol package protocol
import ( import (
"github.com/dubbo/dubbo-go/common/constant"
"github.com/dubbo/dubbo-go/registry"
directory2 "github.com/dubbo/dubbo-go/registry/directory"
"sync" "sync"
) )
...@@ -12,9 +9,12 @@ import ( ...@@ -12,9 +9,12 @@ import (
) )
import ( import (
"github.com/dubbo/dubbo-go/common/constant"
"github.com/dubbo/dubbo-go/common/extension" "github.com/dubbo/dubbo-go/common/extension"
"github.com/dubbo/dubbo-go/config" "github.com/dubbo/dubbo-go/config"
"github.com/dubbo/dubbo-go/protocol" "github.com/dubbo/dubbo-go/protocol"
"github.com/dubbo/dubbo-go/registry"
directory2 "github.com/dubbo/dubbo-go/registry/directory"
) )
const RegistryConnDelay = 3 const RegistryConnDelay = 3
......
package zookeeper package zookeeper
import ( import (
"github.com/dubbo/dubbo-go/config"
jerrors "github.com/juju/errors" jerrors "github.com/juju/errors"
) )
import ( import (
"github.com/dubbo/dubbo-go/config"
"github.com/dubbo/dubbo-go/registry" "github.com/dubbo/dubbo-go/registry"
) )
......
...@@ -3,7 +3,6 @@ package zookeeper ...@@ -3,7 +3,6 @@ package zookeeper
import ( import (
"context" "context"
"fmt" "fmt"
"github.com/dubbo/dubbo-go/config"
"path" "path"
"sync" "sync"
"time" "time"
...@@ -16,6 +15,7 @@ import ( ...@@ -16,6 +15,7 @@ import (
) )
import ( import (
"github.com/dubbo/dubbo-go/config"
"github.com/dubbo/dubbo-go/registry" "github.com/dubbo/dubbo-go/registry"
) )
......
...@@ -3,8 +3,6 @@ package zookeeper ...@@ -3,8 +3,6 @@ package zookeeper
import ( import (
"context" "context"
"fmt" "fmt"
"github.com/dubbo/dubbo-go/common/extension"
"github.com/dubbo/dubbo-go/config"
"net/url" "net/url"
"os" "os"
"strconv" "strconv"
...@@ -20,6 +18,8 @@ import ( ...@@ -20,6 +18,8 @@ import (
) )
import ( import (
"github.com/dubbo/dubbo-go/common/extension"
"github.com/dubbo/dubbo-go/config"
"github.com/dubbo/dubbo-go/registry" "github.com/dubbo/dubbo-go/registry"
"github.com/dubbo/dubbo-go/version" "github.com/dubbo/dubbo-go/version"
) )
...@@ -64,7 +64,7 @@ type ZkRegistry struct { ...@@ -64,7 +64,7 @@ type ZkRegistry struct {
zkPath map[string]int // key = protocol://ip:port/interface zkPath map[string]int // key = protocol://ip:port/interface
} }
func NewZkRegistry( url *config.RegistryURL) (registry.Registry, error) { func NewZkRegistry(url *config.RegistryURL) (registry.Registry, error) {
var ( var (
err error err error
r *ZkRegistry r *ZkRegistry
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment