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

Mod: format the code & add apache license

parent ec67719b
No related branches found
No related tags found
No related merge requests found
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package common
import "fmt"
......
......@@ -18,9 +18,11 @@
package config_center
import (
"github.com/apache/dubbo-go/common"
"time"
)
import (
"github.com/apache/dubbo-go/common"
)
//////////////////////////////////////////
// DynamicConfiguration
......
......@@ -17,13 +17,15 @@
package zookeeper
import (
"sync"
)
import (
"github.com/apache/dubbo-go/common"
"github.com/apache/dubbo-go/common/constant"
"github.com/apache/dubbo-go/common/logger"
"github.com/apache/dubbo-go/config_center"
"github.com/apache/dubbo-go/remoting/zookeeper"
"sync"
)
const ZkClient = "zk config_center"
......
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package zookeeper
import (
"context"
)
import (
perrors "github.com/pkg/errors"
)
import (
"github.com/apache/dubbo-go/common"
"github.com/apache/dubbo-go/common/logger"
"github.com/apache/dubbo-go/registry"
zk "github.com/apache/dubbo-go/remoting/zookeeper"
perrors "github.com/pkg/errors"
)
type RegistryDataListener struct {
......
......@@ -29,7 +29,6 @@ import (
)
import (
"github.com/apache/dubbo-go/common/logger"
perrors "github.com/pkg/errors"
"github.com/samuel/go-zookeeper/zk"
)
......@@ -38,6 +37,7 @@ import (
"github.com/apache/dubbo-go/common"
"github.com/apache/dubbo-go/common/constant"
"github.com/apache/dubbo-go/common/extension"
"github.com/apache/dubbo-go/common/logger"
"github.com/apache/dubbo-go/common/utils"
"github.com/apache/dubbo-go/registry"
"github.com/apache/dubbo-go/remoting/zookeeper"
......
......@@ -19,7 +19,6 @@ package zookeeper
import (
"context"
"github.com/apache/dubbo-go/remoting/zookeeper"
"strconv"
"testing"
"time"
......@@ -32,6 +31,7 @@ import (
import (
"github.com/apache/dubbo-go/common"
"github.com/apache/dubbo-go/common/constant"
"github.com/apache/dubbo-go/remoting/zookeeper"
)
func Test_Register(t *testing.T) {
......
......@@ -18,7 +18,6 @@
package zookeeper
import (
"github.com/apache/dubbo-go/common/constant"
"path"
"strings"
"sync"
......@@ -26,11 +25,15 @@ import (
)
import (
"github.com/apache/dubbo-go/common/logger"
perrors "github.com/pkg/errors"
"github.com/samuel/go-zookeeper/zk"
)
import (
"github.com/apache/dubbo-go/common/constant"
"github.com/apache/dubbo-go/common/logger"
)
const (
ConnDelay = 3
MaxFailTimes = 15
......@@ -220,7 +223,6 @@ func NewMockZookeeperClient(name string, timeout time.Duration, opts ...Option)
return ts, z, event, nil
}
func (z *ZookeeperClient) HandleZkEvent(session <-chan zk.Event) {
var (
state int
......
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package zookeeper
import (
"github.com/apache/dubbo-go/common"
"github.com/apache/dubbo-go/common/logger"
perrors "github.com/pkg/errors"
"sync"
"time"
)
import (
perrors "github.com/pkg/errors"
)
import (
"github.com/apache/dubbo-go/common"
"github.com/apache/dubbo-go/common/logger"
)
type ZkClientContainer interface {
ZkClient() *ZookeeperClient
......
package zookeeper
type DataListener interface {
DataChange(eventType ZkEvent) bool //bool is return for interface implement is interesting
}
......@@ -25,15 +25,19 @@ import (
)
import (
"github.com/apache/dubbo-go/common/logger"
perrors "github.com/pkg/errors"
"github.com/samuel/go-zookeeper/zk"
)
import (
"github.com/apache/dubbo-go/common"
"github.com/apache/dubbo-go/common/logger"
)
type DataListener interface {
DataChange(eventType ZkEvent) bool //bool is return for interface implement is interesting
}
type ZkEvent struct {
Res *common.Event
err error
......
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