Skip to content

Commit

Permalink
fix CI bug
Browse files Browse the repository at this point in the history
  • Loading branch information
smx-Morgan committed Oct 21, 2024
1 parent 10c2d76 commit 24832e5
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 35 deletions.
7 changes: 0 additions & 7 deletions client/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ import (
"github.com/kitex-contrib/config-zookeeper/zookeeper"
)

const (
retryConfigName = "retry"
rpcTimeoutConfigName = "rpc_timeout"
circuitBreakerConfigName = "circuit_break"
degradationConfigName = "degradation"
)

// ZookeeperClientSuite zookeeper client config suite, configure retry timeout limit and circuitbreak dynamically from zookeeper.
type ZookeeperClientSuite = cwclient.ZookeeperClientSuite

Expand Down
5 changes: 0 additions & 5 deletions pkg/degradation/item_degradation.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ import (
degradation "github.com/cloudwego-contrib/cwgo-pkg/config/zookeeper/pkg/degradation"
)

var defaultConfig = &Config{
Enable: false,
Percentage: 0,
}

type Config = degradation.Config

// Container is a wrapper for Config
Expand Down
4 changes: 0 additions & 4 deletions server/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ import (
"github.com/kitex-contrib/config-zookeeper/zookeeper"
)

const (
limiterConfigName = "limit"
)

// ZookeeperServerSuite zookeeper server config suite, configure limiter config dynamically from zookeeper .
type ZookeeperServerSuite = cwserver.ZookeeperServerSuite

Expand Down
24 changes: 7 additions & 17 deletions zookeeper/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@

package zookeeper

import "encoding/json"
import (
utils "github.com/cloudwego-contrib/cwgo-pkg/config/common"
)

const ( //`{{$Prefix}}/{{$ClientName}}/{{$ServerName}}/{{$ConfigCategory}}`
ZookeeperDefaultServer = "127.0.0.1:2181"
Expand All @@ -28,24 +30,12 @@ type CustomFunction func(*ConfigParam)

// ConfigParamConfig use for render the path info by go template, ref: https://pkg.go.dev/text/template
// The fixed key shows as below.
type ConfigParamConfig struct {
Category string
ClientServiceName string
ServerServiceName string
}
type ConfigParamConfig = utils.ConfigParamConfig

// ConfigParser the parser for zookeeper config.
type ConfigParser interface {
Decode(data string, config interface{}) error
}
type parser struct{}

// Decode decodes the data to struct in specified format.
func (p *parser) Decode(data string, config interface{}) error {
return json.Unmarshal([]byte(data), config)
}
type ConfigParser = utils.ConfigParser

// DefaultConfigParser default zookeeper config parser.
func defaultConfigParser() ConfigParser {
return &parser{}
func DefaultConfigParser() ConfigParser {
return utils.DefaultConfigParse()
}
2 changes: 0 additions & 2 deletions zookeeper/uid.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import (
cwzook "github.com/cloudwego-contrib/cwgo-pkg/config/zookeeper/zookeeper"
)

var uniqueID int64

// GetUniqueID get the unique id
func GetUniqueID() int64 {
return cwzook.GetUniqueID()
Expand Down

0 comments on commit 24832e5

Please sign in to comment.