Skip to content
Snippets Groups Projects
Commit 3a7b633f authored by watermelo's avatar watermelo
Browse files

fix: resolve conflict

parents 9a979419 28718ce3
No related branches found
No related tags found
No related merge requests found
Showing
with 245 additions and 60 deletions
......@@ -58,7 +58,6 @@ jobs:
run: |
make verify
- name: Integrate Test
run: |
chmod +x integrate_test.sh && ./integrate_test.sh
......@@ -69,43 +68,3 @@ jobs:
- name: Hello world
run: echo Hello world ${{ secrets.DING_TOKEN }} ${{ secrets.DING_SIGN }}
# Because the contexts of push and PR are different, there are two Notify.
# Notifications are triggered only in the dubbogo/gost repository.
- name: DingTalk Message Notify only Push
uses: zcong1993/actions-ding@v3.0.1
# Whether job is successful or not, always () is always true.
if: |
always() &&
github.event_name == 'push' &&
github.repository == 'apache/dubbo-go'
with:
# DingDing bot token
dingToken: ${{ env.DING_TOKEN }}
secret: ${{ env.DING_SIGN }}
# Post Body to send
body: |
{
"msgtype": "markdown",
"markdown": {
"title": "Github Actions",
"text": "## Github Actions \n - name: CI \n - repository: ${{ github.repository }} \n - trigger: ${{ github.actor }} \n - event: ${{ github.event_name }} \n - ref: ${{ github.ref }} \n - status: [${{ job.status }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) \n - environment: ${{ runner.os }} \n > SHA: [${{ github.sha }}](${{ github.event.compare }})"
}
}
- name: DingTalk Message Notify only PR
uses: zcong1993/actions-ding@v3.0.1
if: |
always() &&
github.event_name == 'pull_request' &&
github.repository == 'dubbogo/gost'
with:
dingToken: ${{ env.DING_TOKEN }}
secret: ${{ env.DING_SIGN }}
body: |
{
"msgtype": "markdown",
"markdown": {
"title": "Github Actions",
"text": "## Github Actions \n - name: CI \n - repository: ${{ github.repository }} \n - pr_title: **${{ github.event.pull_request.title }}** \n - trigger: ${{ github.actor }} \n - event: ${{ github.event_name }} \n - ref: [${{ github.ref }}](${{ github.event.pull_request._links.html.href }}) \n - status: [${{ job.status }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) \n - environment: ${{ runner.os }} \n > SHA: [${{ github.sha }}](${{ github.event.pull_request._links.html.href }})"
}
}
......@@ -15,6 +15,7 @@ install: true
# define ci-stage
script:
- go fmt ./... && [[ -z `git status -s` ]]
# license-check
- make verify
# integrate-test
......
......@@ -83,6 +83,7 @@ func TestRandomlbSelectWeight(t *testing.T) {
}
selectedInvoker = append(selectedInvoker, s)
}
assert.Equal(t, 10000, len(selectedInvoker))
assert.Condition(t, func() bool {
// really is 0.9999999999999
......@@ -114,6 +115,8 @@ func TestRandomlbSelectWarmup(t *testing.T) {
}
selectedInvoker = append(selectedInvoker, s)
}
assert.Equal(t, 10000, len(selectedInvoker))
assert.Condition(t, func() bool {
return selected/10000 < 0.1
})
......
......@@ -195,6 +195,9 @@ func (c *RouterChain) copyInvokerIfNecessary(cache *InvokerCache) []protocol.Inv
func (c *RouterChain) buildCache() {
origin := c.loadCache()
invokers := c.copyInvokerIfNecessary(origin)
if invokers == nil || len(invokers) == 0 {
return
}
var (
mutex sync.Mutex
......@@ -293,8 +296,10 @@ func isInvokersChanged(left []protocol.Invoker, right []protocol.Invoker) bool {
for _, r := range right {
found := false
rurl := r.GetUrl()
for _, l := range left {
if common.IsEquals(l.GetUrl(), r.GetUrl(), constant.TIMESTAMP_KEY, constant.REMOTE_TIMESTAMP_KEY) {
lurl := l.GetUrl()
if common.GetCompareURLEqualFunc()(lurl, rurl, constant.TIMESTAMP_KEY, constant.REMOTE_TIMESTAMP_KEY) {
found = true
break
}
......
......@@ -116,6 +116,9 @@ func TestParseServiceRouterKey(t *testing.T) {
testString = "grp:mock-service:123"
grp, srv, ver, err = parseServiceRouterKey(testString)
assert.Equal(t, "", grp)
assert.Equal(t, "", srv)
assert.Equal(t, "", ver)
assert.Error(t, err)
testString = ""
......
......@@ -46,6 +46,13 @@ var (
routerPatternReg = regexp.MustCompile(`([&!=,]*)\s*([^&!=,\s]+)`)
)
var (
emptyMatchPair = MatchPair{
Matches: gxset.NewSet(),
Mismatches: gxset.NewSet(),
}
)
// ConditionRouter Condition router struct
type ConditionRouter struct {
Pattern string
......@@ -221,14 +228,14 @@ func parseRule(rule string) (map[string]MatchPair, error) {
condition[content] = pair
}
case "=":
if &pair == nil {
if pair == emptyMatchPair {
var startIndex = getStartIndex(rule)
return nil, perrors.Errorf("Illegal route rule \"%s\", The error char '%s' at index %d before \"%d\".", rule, separator, startIndex, startIndex)
}
values = pair.Matches
values.Add(content)
case "!=":
if &pair == nil {
if pair == emptyMatchPair {
var startIndex = getStartIndex(rule)
return nil, perrors.Errorf("Illegal route rule \"%s\", The error char '%s' at index %d before \"%d\".", rule, separator, startIndex, startIndex)
}
......
......@@ -70,10 +70,12 @@ func TestNewConditionRouter(t *testing.T) {
assert.EqualValues(t, router.ThenCondition, thenRule)
router, err = NewConditionRouter(nil)
assert.Nil(t, router)
assert.Error(t, err)
url, _ = common.NewURL(`condition://0.0.0.0:?application=mock-app&category=routers&force=true&priority=1&router=condition&rule=YSAmT4gYiAmIGQ%3D`)
router, err = NewConditionRouter(url)
assert.Nil(t, router)
assert.Error(t, err)
url, _ = common.NewURL(`condition://0.0.0.0:?application=mock-app&category=routers&force=true&router=condition&rule=YSAmIGMgPT4gYiAmIGQ%3D`)
......
......@@ -56,6 +56,7 @@ func TestDefaultHealthCheckerIsHealthy(t *testing.T) {
}
hc = NewDefaultHealthChecker(url).(*DefaultHealthChecker)
healthy = hc.IsHealthy(invoker)
assert.False(t, false, healthy)
// the outgoing request is more than OUTSTANDING_REQUEST_COUNT_LIMIT, go to unhealthy
assert.False(t, hc.IsHealthy(invoker))
......@@ -67,11 +68,13 @@ func TestDefaultHealthCheckerIsHealthy(t *testing.T) {
url.SetParam(constant.OUTSTANDING_REQUEST_COUNT_LIMIT_KEY, "1000")
hc = NewDefaultHealthChecker(url).(*DefaultHealthChecker)
healthy = hc.IsHealthy(invoker)
assert.False(t, false, healthy)
assert.False(t, hc.IsHealthy(invoker))
// reset successive failed count and go to healthy
request(url, healthCheckMethodTest, 0, false, true)
healthy = hc.IsHealthy(invoker)
assert.False(t, false, healthy)
assert.True(t, hc.IsHealthy(invoker))
}
......
......@@ -127,6 +127,7 @@ const (
TAG_ROUTE_PROTOCOL = "tag"
PROVIDERS_CATEGORY = "providers"
ROUTER_KEY = "router"
EXPORT_KEY = "export"
)
const (
......@@ -200,6 +201,8 @@ const (
TRACING_REMOTE_SPAN_CTX = "tracing.remote.span.ctx"
)
type AttachmentCtxKey string
// Use for router module
const (
// ConditionRouterName Specify file condition router name
......@@ -237,7 +240,7 @@ const (
Tagkey = "dubbo.tag"
// Attachment key in context in invoker
AttachmentKey = "attachment"
AttachmentKey = AttachmentCtxKey("attachment")
)
const (
......@@ -264,7 +267,7 @@ const (
// signature format
SIGNATURE_STRING_FORMAT = "%s#%s#%s#%s"
// key whether enable signature
PARAMTER_SIGNATURE_ENABLE_KEY = "param.sign"
PARAMETER_SIGNATURE_ENABLE_KEY = "param.sign"
// consumer
CONSUMER = "consumer"
// key of access key id
......@@ -292,7 +295,7 @@ const (
HEALTH_CHECKER = "health.checker"
// The name of the default implementation of HealthChecker
DEFAULT_HEALTH_CHECKER = "default"
// The key of oustanding-request-limit
// The key of outstanding-request-limit
OUTSTANDING_REQUEST_COUNT_LIMIT_KEY = "outstanding.request.limit"
// The key of successive-failed-request's threshold
SUCCESSIVE_FAILED_REQUEST_THRESHOLD_KEY = "successive.failed.threshold"
......
/*
* 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 extension
import (
"github.com/apache/dubbo-go/config/interfaces"
)
var (
processors = make(map[string]interfaces.ConfigPostProcessor)
)
// SetConfigPostProcessor registers a ConfigPostProcessor with the given name.
func SetConfigPostProcessor(name string, processor interfaces.ConfigPostProcessor) {
processors[name] = processor
}
// GetConfigPostProcessor finds a ConfigPostProcessor by name.
func GetConfigPostProcessor(name string) interfaces.ConfigPostProcessor {
return processors[name]
}
// GetConfigPostProcessors returns all registered instances of ConfigPostProcessor.
func GetConfigPostProcessors() []interfaces.ConfigPostProcessor {
ret := make([]interfaces.ConfigPostProcessor, 0, len(processors))
for _, v := range processors {
ret = append(ret, v)
}
return ret
}
......@@ -158,15 +158,11 @@ func (p *Proxy) Implement(v common.RPCService) {
}
result := p.invoke.Invoke(invCtx, inv)
if len(result.Attachments()) > 0 {
invCtx = context.WithValue(invCtx, constant.AttachmentKey, result.Attachments())
}
err = result.Error()
if err != nil {
// the cause reason
err = perrors.Cause(err)
// if some error happened, it should be log some info in the seperate file.
// if some error happened, it should be log some info in the separate file.
if throwabler, ok := err.(java_exception.Throwabler); ok {
logger.Warnf("invoke service throw exception: %v , stackTraceElements: %v", err.Error(), throwabler.GetStackTrace())
} else {
......@@ -234,3 +230,8 @@ func (p *Proxy) Get() common.RPCService {
func (p *Proxy) GetCallback() interface{} {
return p.callBack
}
// GetInvoker gets Invoker.
func (p *Proxy) GetInvoker() protocol.Invoker {
return p.invoke
}
......@@ -156,13 +156,13 @@ type serviceMap struct {
interfaceMap map[string][]*Service // interface -> service
}
// GetService gets a service defination by protocol and name
// GetService gets a service definition by protocol and name
func (sm *serviceMap) GetService(protocol, interfaceName, group, version string) *Service {
serviceKey := ServiceKey(interfaceName, group, version)
return sm.GetServiceByServiceKey(protocol, serviceKey)
}
// GetService gets a service defination by protocol and service key
// GetService gets a service definition by protocol and service key
func (sm *serviceMap) GetServiceByServiceKey(protocol, serviceKey string) *Service {
sm.mutex.RLock()
defer sm.mutex.RUnlock()
......
......@@ -132,7 +132,10 @@ func TestServiceMapUnRegister(t *testing.T) {
func TestMethodTypeSuiteContext(t *testing.T) {
mt := &MethodType{ctxType: reflect.TypeOf(context.TODO())}
ctx := context.WithValue(context.Background(), "key", "value")
ctx := context.Background()
type ctxKey string
key := ctxKey("key")
ctx = context.WithValue(ctx, key, "value")
assert.Equal(t, reflect.ValueOf(ctx), mt.SuiteContext(ctx))
assert.Equal(t, reflect.Zero(mt.ctxType), mt.SuiteContext(nil))
......
......@@ -64,8 +64,14 @@ var (
DubboNodes = [...]string{"consumers", "configurators", "routers", "providers"}
// DubboRole Dubbo service role
DubboRole = [...]string{"consumer", "", "routers", "provider"}
// CompareURLEqualFunc compare two url is equal
compareURLEqualFunc CompareURLEqualFunc
)
func init() {
compareURLEqualFunc = defaultCompareURLEqual
}
// nolint
type RoleType int
......@@ -317,6 +323,8 @@ func isMatchCategory(category1 string, category2 string) bool {
}
func (c *URL) String() string {
c.paramsLock.Lock()
defer c.paramsLock.Unlock()
var buf strings.Builder
if len(c.Username) == 0 && len(c.Password) == 0 {
buf.WriteString(fmt.Sprintf("%s://%s:%s%s?", c.Protocol, c.Ip, c.Port, c.Path))
......@@ -427,6 +435,13 @@ func (c *URL) SetParam(key string, value string) {
c.params.Set(key, value)
}
// DelParam will delete the given key from the url
func (c *URL) DelParam(key string) {
c.paramsLock.Lock()
defer c.paramsLock.Unlock()
c.params.Del(key)
}
// ReplaceParams will replace the URL.params
// usually it should only be invoked when you want to modify an url, such as MergeURL
func (c *URL) ReplaceParams(param url.Values) {
......@@ -724,6 +739,9 @@ func (c *URL) CloneWithParams(reserveParams []string) *URL {
// IsEquals compares if two URLs equals with each other. Excludes are all parameter keys which should ignored.
func IsEquals(left *URL, right *URL, excludes ...string) bool {
if (left == nil && right != nil) || (right == nil && left != nil) {
return false
}
if left.Ip != right.Ip || left.Port != right.Port {
return false
}
......@@ -783,3 +801,17 @@ func (s URLSlice) Less(i, j int) bool {
func (s URLSlice) Swap(i, j int) {
s[i], s[j] = s[j], s[i]
}
type CompareURLEqualFunc func(l *URL, r *URL, excludeParam ...string) bool
func defaultCompareURLEqual(l *URL, r *URL, excludeParam ...string) bool {
return IsEquals(l, r, excludeParam...)
}
func SetCompareURLEqualFunc(f CompareURLEqualFunc) {
compareURLEqualFunc = f
}
func GetCompareURLEqualFunc() CompareURLEqualFunc {
return compareURLEqualFunc
}
......@@ -339,5 +339,56 @@ func TestColonSeparatedKey(t *testing.T) {
assert.Equal(t, u1.ColonSeparatedKey(), u1.GetParam(constant.INTERFACE_KEY, "")+":version1:group1")
u1.SetParam(constant.VERSION_KEY, "")
assert.Equal(t, u1.ColonSeparatedKey(), u1.GetParam(constant.INTERFACE_KEY, "")+"::group1")
}
func TestCompareURLEqualFunc(t *testing.T) {
// test Default
url1, _ := NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider?anyhost=true&" +
"application=BDTService&category=providers&default.timeout=10000&dubbo=dubbo-provider-golang-1.0.0&" +
"environment=dev&interface=com.ikurento.user.UserProvider&ip=192.168.56.1&methods=GetUser%2C&" +
"module=dubbogo+user-info+server&org=ikurento.com&owner=ZX&pid=1447&revision=0.0.1&" +
"side=provider&timeout=3000&timestamp=1556509797245")
url2, _ := NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider?anyhost=true&" +
"application=BDTService&category=providers&default.timeout=10000&dubbo=dubbo-provider-golang-1.0.0&" +
"environment=dev&interface=com.ikurento.user.UserProvider&ip=192.168.56.1&methods=GetUser%2C&" +
"module=dubbogo+user-info+server&org=ikurento.com&owner=ZX&pid=1447&revision=0.0.1&" +
"side=provider&timeout=3000&timestamp=155650979798")
assert.False(t, GetCompareURLEqualFunc()(url1, url2))
assert.True(t, GetCompareURLEqualFunc()(url1, url2, constant.TIMESTAMP_KEY, constant.REMOTE_TIMESTAMP_KEY))
// test custom
url1, _ = NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider?anyhost=true&" +
"application=BDTService&category=providers&default.timeout=10000&dubbo=dubbo-provider-golang-1.0.0&" +
"environment=dev&interface=com.ikurento.user.UserProvider&ip=192.168.56.1&methods=GetUser%2C&" +
"module=dubbogo+user-info+server&org=ikurento.com&owner=ZX&pid=1447&revision=0.0.1&" +
"side=provider&timeout=3000&timestamp=1556509797245")
url2, _ = NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider?anyhost=true&" +
"application=BDTService&category=providers&default.timeout=10000&dubbo=dubbo-provider-golang-1.0.0&" +
"environment=dev&interface=com.ikurento.user.UserProvider&ip=192.168.56.1&methods=GetUser%2C&" +
"module=dubbogo+user-info+server&org=ikurento.com&owner=ZX&pid=1447&revision=0.0.1&" +
"side=provider&timeout=3000&timestamp=155650979798")
assert.True(t, GetCompareURLEqualFunc()(url1, url2, constant.TIMESTAMP_KEY, constant.REMOTE_TIMESTAMP_KEY))
SetCompareURLEqualFunc(CustomCompareURLEqual)
assert.False(t, GetCompareURLEqualFunc()(url1, url2))
assert.False(t, GetCompareURLEqualFunc()(url1, url2, constant.TIMESTAMP_KEY, constant.REMOTE_TIMESTAMP_KEY))
url1, _ = NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider?anyhost=true&" +
"application=BDTService&category=providers&default.timeout=10000&dubbo=dubbo-provider-golang-1.0.0&" +
"environment=dev&interface=com.ikurento.user.UserProvider&ip=192.168.56.1&methods=GetUser%2C&" +
"module=dubbogo+user-info+server&org=ikurento.com&owner=ZX&pid=1447&revision=0.0.1&" +
"side=provider&timeout=3000")
url2, _ = NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider?anyhost=true&" +
"application=BDTService&category=providers&default.timeout=10000&dubbo=dubbo-provider-golang-1.0.0&" +
"environment=dev&interface=com.ikurento.user.UserProvider&ip=192.168.56.1&methods=GetUser%2C&" +
"module=dubbogo+user-info+server&org=ikurento.com&owner=ZX&pid=1447&revision=0.0.1&" +
"side=provider&timeout=3000")
assert.True(t, GetCompareURLEqualFunc()(url1, url2))
assert.True(t, GetCompareURLEqualFunc()(url1, url2, constant.TIMESTAMP_KEY, constant.REMOTE_TIMESTAMP_KEY))
SetCompareURLEqualFunc(CustomCompareURLEqual)
assert.True(t, GetCompareURLEqualFunc()(url1, url2))
assert.True(t, GetCompareURLEqualFunc()(url1, url2, constant.TIMESTAMP_KEY, constant.REMOTE_TIMESTAMP_KEY))
}
func CustomCompareURLEqual(l *URL, r *URL, execludeParam ...string) bool {
return l.PrimitiveURL == r.PrimitiveURL
}
......@@ -66,5 +66,5 @@ type Config struct {
}
type ChildConfig struct {
StrTest string `default:"strTest" default:"default" yaml:"strTest" json:"strTest,omitempty"`
StrTest string `default:"default" yaml:"strTest" json:"strTest,omitempty"`
}
/*
* 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 interfaces
import (
"github.com/apache/dubbo-go/common"
)
// ConfigPostProcessor is an extension to give users a chance to customize configs against ReferenceConfig and
// ServiceConfig during deployment time.
type ConfigPostProcessor interface {
// PostProcessReferenceConfig customizes ReferenceConfig's params.
PostProcessReferenceConfig(*common.URL)
// PostProcessServiceConfig customizes ServiceConfig's params.
PostProcessServiceConfig(*common.URL)
}
......@@ -100,6 +100,9 @@ func (c *ReferenceConfig) Refer(_ interface{}) {
if c.ForceTag {
cfgURL.AddParam(constant.ForceUseTag, "true")
}
c.postProcessConfig(cfgURL)
if c.Url != "" {
// 1. user specified URL, could be peer-to-peer address, or register center's address.
urlStrings := gxstrings.RegSplit(c.Url, "\\s*[;]+\\s*")
......@@ -185,6 +188,11 @@ func (c *ReferenceConfig) GetRPCService() common.RPCService {
return c.pxy.Get()
}
// GetProxy gets proxy
func (c *ReferenceConfig) GetProxy() *proxy.Proxy {
return c.pxy
}
func (c *ReferenceConfig) getUrlMap() url.Values {
urlMap := url.Values{}
//first set user params
......@@ -248,3 +256,10 @@ func (c *ReferenceConfig) GenericLoad(id string) {
c.Refer(genericService)
c.Implement(genericService)
}
// postProcessConfig asks registered ConfigPostProcessor to post-process the current ReferenceConfig.
func (c *ReferenceConfig) postProcessConfig(url *common.URL) {
for _, p := range extension.GetConfigPostProcessors() {
p.PostProcessReferenceConfig(url)
}
}
......@@ -78,6 +78,7 @@ type ServiceConfig struct {
Protocols map[string]*ProtocolConfig
unexported *atomic.Bool
exported *atomic.Bool
export bool // a flag to control whether the current service should export or not
rpcService common.RPCService
cacheMutex sync.Mutex
cacheProtocol protocol.Protocol
......@@ -102,6 +103,7 @@ func (c *ServiceConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
}
c.exported = atomic.NewBool(false)
c.unexported = atomic.NewBool(false)
c.export = true
return nil
}
......@@ -112,6 +114,7 @@ func NewServiceConfig(id string, context context.Context) *ServiceConfig {
id: id,
unexported: atomic.NewBool(false),
exported: atomic.NewBool(false),
export: true,
}
}
......@@ -198,6 +201,13 @@ func (c *ServiceConfig) Export() error {
ivkURL.AddParam(constant.Tagkey, c.Tag)
}
// post process the URL to be exported
c.postProcessConfig(ivkURL)
// config post processor may set "export" to false
if !ivkURL.GetParamBool(constant.EXPORT_KEY, true) {
return nil
}
if len(regUrls) > 0 {
c.cacheMutex.Lock()
if c.cacheProtocol == nil {
......@@ -302,7 +312,10 @@ func (c *ServiceConfig) getUrlMap() url.Values {
// auth filter
urlMap.Set(constant.SERVICE_AUTH_KEY, c.Auth)
urlMap.Set(constant.PARAMTER_SIGNATURE_ENABLE_KEY, c.ParamSign)
urlMap.Set(constant.PARAMETER_SIGNATURE_ENABLE_KEY, c.ParamSign)
// whether to export or not
urlMap.Set(constant.EXPORT_KEY, strconv.FormatBool(c.export))
for _, v := range c.Methods {
prefix := "methods." + v.Name + "."
......@@ -332,3 +345,10 @@ func (c *ServiceConfig) GetExportedUrls() []*common.URL {
}
return nil
}
// postProcessConfig asks registered ConfigPostProcessor to post-process the current ServiceConfig.
func (c *ServiceConfig) postProcessConfig(url *common.URL) {
for _, p := range extension.GetConfigPostProcessors() {
p.PostProcessServiceConfig(url)
}
}
......@@ -126,17 +126,17 @@ func initApollo() *httptest.Server {
}
func configResponse(rw http.ResponseWriter, _ *http.Request) {
result := fmt.Sprintf(mockConfigRes)
result := mockConfigRes
fmt.Fprintf(rw, "%s", result)
}
func notifyResponse(rw http.ResponseWriter, req *http.Request) {
result := fmt.Sprintf(mockNotifyRes)
result := mockNotifyRes
fmt.Fprintf(rw, "%s", result)
}
func serviceConfigResponse(rw http.ResponseWriter, _ *http.Request) {
result := fmt.Sprintf(mockServiceConfigRes)
result := mockServiceConfigRes
fmt.Fprintf(rw, "%s", result)
}
......
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