Skip to content

Commit

Permalink
Add:add license header & format code
Browse files Browse the repository at this point in the history
  • Loading branch information
hxmhlt committed Sep 6, 2019
1 parent 4e2382b commit 4c1886f
Show file tree
Hide file tree
Showing 23 changed files with 149 additions and 11 deletions.
5 changes: 4 additions & 1 deletion common/config/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ package config

import (
"container/list"
"github.com/apache/dubbo-go/config_center"
"strings"
"sync"
)

import (
"github.com/apache/dubbo-go/config_center"
)

// There is dubbo.properties file and application level config center configuration which higner than normal config center in java. So in java the
// configuration sequence will be config center > application level config center > dubbo.properties > spring bean configuration.
// But in go, neither the dubbo.properties file or application level config center configuration will not support for the time being.
Expand Down
1 change: 1 addition & 0 deletions common/config/environment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package config
import (
"testing"
)

import (
"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 2 additions & 0 deletions config/base_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ import (
"reflect"
"strconv"
)

import (
perrors "github.com/pkg/errors"
)

import (
"github.com/apache/dubbo-go/common"
"github.com/apache/dubbo-go/common/config"
Expand Down
1 change: 1 addition & 0 deletions config/config_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"regexp"
"strings"
)

import (
"github.com/apache/dubbo-go/common/constant"
)
Expand Down
2 changes: 2 additions & 0 deletions config/consumer_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ import (
"path"
"time"
)

import (
perrors "github.com/pkg/errors"
"gopkg.in/yaml.v2"
)

import (
"github.com/apache/dubbo-go/common/constant"
"github.com/apache/dubbo-go/common/logger"
Expand Down
1 change: 1 addition & 0 deletions config/protocol_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package config
import (
"strings"
)

import (
"github.com/apache/dubbo-go/common/constant"
)
Expand Down
6 changes: 5 additions & 1 deletion config/registry_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@ import (
"fmt"
"testing"
)

import (
"github.com/apache/dubbo-go/common"
"github.com/stretchr/testify/assert"
)

import (
"github.com/apache/dubbo-go/common"
)

func Test_loadRegistries(t *testing.T) {
target := "shanghai1"
regs := map[string]*RegistryConfig{
Expand Down
18 changes: 18 additions & 0 deletions config_center/configuration_listener.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
/*
* 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 config_center

import (
"fmt"
)

import (
"github.com/apache/dubbo-go/remoting"
)
Expand Down
17 changes: 17 additions & 0 deletions config_center/configurator.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* 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 config_center

import (
Expand Down
2 changes: 2 additions & 0 deletions config_center/configurator/override.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ package configurator
import (
"strings"
)

import (
"github.com/dubbogo/gost/container"
)

import (
"github.com/apache/dubbo-go/common"
"github.com/apache/dubbo-go/common/constant"
Expand Down
2 changes: 2 additions & 0 deletions config_center/configurator/override_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ import (
"context"
"testing"
)

import (
"github.com/stretchr/testify/assert"
)

import (
"github.com/apache/dubbo-go/common"
"github.com/apache/dubbo-go/common/constant"
Expand Down
1 change: 1 addition & 0 deletions config_center/dynamic_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package config_center
import (
"time"
)

import (
"github.com/apache/dubbo-go/config_center/parser"
)
Expand Down
10 changes: 7 additions & 3 deletions config_center/mock_dynamic_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,18 @@
package config_center

import (
"github.com/apache/dubbo-go/common/constant"
"github.com/apache/dubbo-go/remoting"
"gopkg.in/yaml.v2"
"sync"
)

import (
"gopkg.in/yaml.v2"
)

import (
"github.com/apache/dubbo-go/common"
"github.com/apache/dubbo-go/common/constant"
"github.com/apache/dubbo-go/config_center/parser"
"github.com/apache/dubbo-go/remoting"
)

type MockDynamicConfigurationFactory struct{}
Expand Down
19 changes: 19 additions & 0 deletions config_center/parser/configuration_parser.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,34 @@
/*
* 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 parser

import (
"context"
"strconv"
"strings"
)

import (
"github.com/magiconair/properties"
perrors "github.com/pkg/errors"
"gopkg.in/yaml.v2"
)

import (
"github.com/apache/dubbo-go/common"
"github.com/apache/dubbo-go/common/constant"
Expand Down
18 changes: 18 additions & 0 deletions config_center/parser/configuration_parser_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
/*
* 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 parser

import (
"testing"
)

import (
"github.com/stretchr/testify/assert"
)
Expand Down
3 changes: 2 additions & 1 deletion config_center/zookeeper/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@
package zookeeper

import (
"github.com/apache/dubbo-go/config_center/parser"
"sync"
)

import (
"github.com/apache/dubbo-go/common"
"github.com/apache/dubbo-go/common/extension"
"github.com/apache/dubbo-go/config_center"
"github.com/apache/dubbo-go/config_center/parser"
)

func init() {
Expand Down
4 changes: 3 additions & 1 deletion config_center/zookeeper/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,22 @@
package zookeeper

import (
"github.com/apache/dubbo-go/config_center/parser"
"strings"
"sync"
"time"
)

import (
perrors "github.com/pkg/errors"
"github.com/samuel/go-zookeeper/zk"
)

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/config_center/parser"
"github.com/apache/dubbo-go/remoting/zookeeper"
)

Expand Down
1 change: 1 addition & 0 deletions config_center/zookeeper/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"strings"
"sync"
)

import (
"github.com/apache/dubbo-go/config_center"
"github.com/apache/dubbo-go/remoting"
Expand Down
17 changes: 17 additions & 0 deletions registry/base_configuration_listener.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* 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 registry

import (
Expand Down
7 changes: 5 additions & 2 deletions registry/mock_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@
package registry

import (
"github.com/apache/dubbo-go/common/logger"
"go.uber.org/atomic"
"time"
)

import (
"go.uber.org/atomic"
)

import (
"github.com/apache/dubbo-go/common"
"github.com/apache/dubbo-go/common/logger"
)

type MockRegistry struct {
Expand Down
2 changes: 1 addition & 1 deletion registry/protocol/protocol_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package protocol

import (
"context"
"github.com/apache/dubbo-go/remoting"
"testing"
"time"
)
Expand All @@ -40,6 +39,7 @@ import (
"github.com/apache/dubbo-go/protocol"
"github.com/apache/dubbo-go/protocol/protocolwrapper"
"github.com/apache/dubbo-go/registry"
"github.com/apache/dubbo-go/remoting"
)

func init() {
Expand Down
4 changes: 3 additions & 1 deletion registry/zookeeper/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@ package zookeeper

import (
"context"
"github.com/apache/dubbo-go/config_center"
"strings"
)

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/config_center"
"github.com/apache/dubbo-go/registry"
"github.com/apache/dubbo-go/remoting"
zk "github.com/apache/dubbo-go/remoting/zookeeper"
Expand Down
17 changes: 17 additions & 0 deletions registry/zookeeper/listener_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* 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 (
Expand Down

0 comments on commit 4c1886f

Please sign in to comment.