[go: nahoru, domu]

Skip to content
This repository has been archived by the owner on Dec 3, 2019. It is now read-only.

Commit

Permalink
use foundation 0.1.0 (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
tianxiaoliang committed Nov 8, 2019
1 parent 0cb5c5e commit 0b3e5cc
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
2 changes: 0 additions & 2 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@ func TestEnable(t *testing.T) {
ServerURI: "http://127.0.0.1:30100",
})
assert.NoError(t, err)
_, err = c.PullConfigs("service", "app", "1.0", "")
assert.Error(t, err)
}
6 changes: 3 additions & 3 deletions configcenter/config_center.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
package configcenter

import (
"github.com/go-mesh/openlogging"

"errors"
"strings"

"github.com/go-chassis/go-chassis-config"
"github.com/go-chassis/go-chassis-config/pkg/configcenter"
"github.com/go-mesh/openlogging"
"github.com/gorilla/websocket"
"strings"
)

const (
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
module github.com/go-chassis/go-chassis-config

require (
github.com/go-chassis/foundation v0.0.0-20190621030543-c3b63f787f4c
github.com/go-chassis/foundation v0.1.0
github.com/go-mesh/openlogging v1.0.1
github.com/gorilla/websocket v1.4.0
github.com/stretchr/testify v1.3.0
)

go 1.13
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-chassis/foundation v0.0.0-20190621030543-c3b63f787f4c h1:p+Y6yq7RwHmYjEr/vwdVYGacBqFCc2lPQfNRIC3vRIs=
github.com/go-chassis/foundation v0.0.0-20190621030543-c3b63f787f4c/go.mod h1:21/ajGtgJlWTCeM0TxGJdRhO8bJkKirWyV8Stlh6g6c=
github.com/go-chassis/foundation v0.1.0 h1:ixjSxwUyJS8RkASYz0dNe5ApAL+gec7ejgsU84tIVnw=
github.com/go-chassis/foundation v0.1.0/go.mod h1:21/ajGtgJlWTCeM0TxGJdRhO8bJkKirWyV8Stlh6g6c=
github.com/go-mesh/openlogging v1.0.1 h1:6raaXo8SK+wuQX1VoNi6QJCSf1fTOFWh7f5f6b2ZEmY=
github.com/go-mesh/openlogging v1.0.1/go.mod h1:qaKi+amO+hsGin2q1GmW+/NcbZpMPnTufwrWzDmIuuU=
github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q=
Expand Down
7 changes: 4 additions & 3 deletions pkg/configcenter/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package configcenter

import (
"context"
"errors"
"fmt"
"github.com/go-chassis/foundation/httpclient"
Expand Down Expand Up @@ -75,7 +76,7 @@ var (
type Client struct {
opts Options
sync.RWMutex
c *httpclient.URLClient
c *httpclient.Requests
wsDialer *websocket.Dialer
wsConnection *websocket.Conn
}
Expand All @@ -97,7 +98,7 @@ func New(opts Options) (*Client, error) {
}
updateAPIPath(apiVersion)

hc, err := httpclient.GetURLClient(&httpclient.URLClientOption{
hc, err := httpclient.New(&httpclient.Options{
SSLEnabled: opts.EnableSSL,
TLSConfig: opts.TLSConfig,
Compressed: false,
Expand Down Expand Up @@ -188,7 +189,7 @@ func (c *Client) HTTPDo(method string, rawURL string, headers http.Header, body
for k, v := range GetDefaultHeaders(c.opts.TenantName) {
headers[k] = v
}
return c.c.HTTPDo(method, rawURL, headers, body)
return c.c.Do(context.Background(), method, rawURL, headers, body)
}

// Flatten pulls all the configuration from config center and merge kv in different dimension
Expand Down

0 comments on commit 0b3e5cc

Please sign in to comment.