Skip to content
Snippets Groups Projects
Commit 16274df7 authored by flycash's avatar flycash
Browse files

Fix import

parent 0dcd48f5
No related branches found
No related tags found
No related merge requests found
......@@ -130,8 +130,7 @@ func (c *apolloConfiguration) GetRule(key string, opts ...cc.Option) (string, er
// PublishConfig will publish the config with the (key, group, value) pair
func (c *apolloConfiguration) PublishConfig(string, string, string) error {
// todo(@zouyx)
return nil
return errors.New("unsupport operation")
}
func (c *apolloConfiguration) GetProperties(key string, opts ...cc.Option) (string, error) {
......
......@@ -53,7 +53,6 @@ type DynamicConfiguration interface {
// PublishConfig will publish the config with the (key, group, value) pair
PublishConfig(string, string, string) error
}
// Options ...
......
......@@ -18,7 +18,6 @@
package nacos
import (
"errors"
"strings"
"sync"
)
......@@ -92,16 +91,16 @@ func (nacos *nacosDynamicConfiguration) PublishConfig(key string, group string,
group = nacos.resolvedGroup(group)
ok, err := (*nacos.client.Client()).PublishConfig(vo.ConfigParam{
DataId: key,
Group: group,
Content: value,
DataId: key,
Group: group,
Content: value,
})
if err != nil {
return err
}
if !ok {
return errors.New("publish config to Nocos failed")
return perrors.New("publish config to Nocos failed")
}
return nil
}
......@@ -170,7 +169,7 @@ func (nacos *nacosDynamicConfiguration) Destroy() {
// resolvedGroup will regular the group. Now, it will replace the '/' with '-'.
// '/' is a special character for nacos
func (nacos *nacosDynamicConfiguration) resolvedGroup(group string) string {
if len(group) <=0 {
if len(group) <= 0 {
return group
}
return strings.ReplaceAll(group, "/", "-")
......
......@@ -40,7 +40,7 @@ import (
const (
// ZkClient
//zookeeper client name
ZkClient = "zk config_center"
ZkClient = "zk config_center"
pathSeparator = "/"
)
......@@ -228,7 +228,7 @@ func (c *zookeeperDynamicConfiguration) RestartCallBack() bool {
func (c *zookeeperDynamicConfiguration) getPath(key string, group string) string {
if len(key) <= 0 {
return c.buildPath(group)
return c.buildPath(group)
}
return c.buildPath(group) + pathSeparator + key
}
......
......@@ -431,8 +431,6 @@ func (z *ZookeeperClient) CreateWithValue(basePath string, value []byte) error {
return nil
}
// Delete ...
func (z *ZookeeperClient) Delete(basePath string) error {
var (
......
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