This is an automated email from the ASF dual-hosted git repository.
tianxiaoliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-kie.git
The following commit(s) were added to refs/heads/master by this push:
new d564a5a upgrade to latest go chassis (#51)
d564a5a is described below
commit d564a5ac01152acdd206cd7c9ec7725bd8e13bf5
Author: Shawn <[email protected]>
AuthorDate: Tue Nov 19 19:27:52 2019 +0800
upgrade to latest go chassis (#51)
---
client/client.go | 16 ++++++++--------
go.mod | 6 +++---
go.sum | 7 +++++++
3 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/client/client.go b/client/client.go
index 15a7163..342038b 100644
--- a/client/client.go
+++ b/client/client.go
@@ -23,11 +23,11 @@ import (
"encoding/json"
"errors"
"fmt"
- "github.com/apache/servicecomb-kie/pkg/common"
"net/http"
"net/url"
"strings"
+ "github.com/apache/servicecomb-kie/pkg/common"
"github.com/apache/servicecomb-kie/pkg/model"
"github.com/go-chassis/foundation/httpclient"
"github.com/go-chassis/foundation/security"
@@ -51,7 +51,7 @@ var (
type Client struct {
opts Config
cipher security.Cipher
- c *httpclient.URLClient
+ c *httpclient.Requests
}
//Config is the config of client
@@ -67,13 +67,13 @@ func New(config Config) (*Client, error) {
if err != nil {
return nil, err
}
- httpOpts := &httpclient.URLClientOption{}
+ httpOpts := &httpclient.Options{}
if u.Scheme == "https" {
httpOpts.TLSConfig = &tls.Config{
InsecureSkipVerify: !config.VerifyPeer,
}
}
- c, err := httpclient.GetURLClient(httpOpts)
+ c, err := httpclient.New(httpOpts)
if err != nil {
return nil, err
}
@@ -96,7 +96,7 @@ func (c *Client) Put(ctx context.Context, kv model.KVRequest,
opts ...OpOption)
h := http.Header{}
h.Set("Content-Type", "application/json")
body, _ := json.Marshal(kv)
- resp, err := c.c.HTTPDoWithContext(ctx, "PUT", url, h, body)
+ resp, err := c.c.Do(ctx, "PUT", url, h, body)
if err != nil {
return nil, err
}
@@ -133,7 +133,7 @@ func (c *Client) Get(ctx context.Context, key string, opts
...GetOption) ([]*mod
}
url := fmt.Sprintf("%s/%s/%s/%s/%s", c.opts.Endpoint, version,
options.Project, APIPathKV, key)
h := http.Header{}
- resp, err := c.c.HTTPDoWithContext(ctx, "GET", url, h, nil)
+ resp, err := c.c.Do(ctx, "GET", url, h, nil)
if err != nil {
return nil, err
}
@@ -183,7 +183,7 @@ func (c *Client) SearchByLabels(ctx context.Context, opts
...GetOption) ([]*mode
}
url := fmt.Sprintf("%s/%s/%s/%s?%s", c.opts.Endpoint, version,
options.Project, APIPathKV, lableReq)
h := http.Header{}
- resp, err := c.c.HTTPDoWithContext(ctx, "GET", url, h, nil)
+ resp, err := c.c.Do(ctx, "GET", url, h, nil)
if err != nil {
return nil, err
}
@@ -223,7 +223,7 @@ func (c *Client) Delete(ctx context.Context, kvID, labelID
string, opts ...OpOpt
}
h := http.Header{}
h.Set("Content-Type", "application/json")
- resp, err := c.c.HTTPDoWithContext(ctx, "DELETE", url, h, nil)
+ resp, err := c.c.Do(ctx, "DELETE", url, h, nil)
if err != nil {
return err
}
diff --git a/go.mod b/go.mod
index 8d3d8b5..9a2103c 100644
--- a/go.mod
+++ b/go.mod
@@ -2,10 +2,10 @@ module github.com/apache/servicecomb-kie
require (
github.com/emicklei/go-restful v2.11.1+incompatible
- github.com/go-chassis/foundation v0.0.0-20190621030543-c3b63f787f4c
+ github.com/go-chassis/foundation v0.1.1-0.20191113114104-2b05871e9ec4
github.com/go-chassis/go-archaius v0.24.0
- github.com/go-chassis/go-chassis v1.7.4-0.20191031115844-2d2fe55920d0
- github.com/go-chassis/go-chassis-config v0.14.0
+ github.com/go-chassis/go-chassis v1.7.6
+ github.com/go-chassis/go-chassis-config v0.15.0
github.com/go-chassis/go-restful-swagger20
v1.0.2-0.20191118130439-7eec0f2639f6
github.com/go-chassis/paas-lager v1.0.2-0.20190328010332-cf506050ddb2
github.com/go-mesh/openlogging v1.0.1
diff --git a/go.sum b/go.sum
index 1cb76d6..8181297 100644
--- a/go.sum
+++ b/go.sum
@@ -15,6 +15,9 @@ github.com/fsnotify/fsnotify v1.4.7
h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV
github.com/fsnotify/fsnotify v1.4.7/go.mod
h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
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/go.mod
h1:21/ajGtgJlWTCeM0TxGJdRhO8bJkKirWyV8Stlh6g6c=
+github.com/go-chassis/foundation v0.1.1-0.20191113114104-2b05871e9ec4
h1:wx8JXvg/n4i8acXsBJ5zIkiK7EO2kn/HuEjKK3kSgv8=
+github.com/go-chassis/foundation v0.1.1-0.20191113114104-2b05871e9ec4/go.mod
h1:21/ajGtgJlWTCeM0TxGJdRhO8bJkKirWyV8Stlh6g6c=
github.com/go-chassis/go-archaius v0.24.0
h1:ubNgs3Rv067PI7t37ZJoIMaPPHIBWV+ni/e7XAdW1hU=
github.com/go-chassis/go-archaius v0.24.0/go.mod
h1:5kKZrxGYvKNorKamngLdPe3vVasAtIeB5vDcAv8Vg9I=
github.com/go-chassis/go-chassis v1.7.3-0.20191018125535-1a99ab41f7ea
h1:Gm7df0N6uafuCCPvdMrihLvzKEu4Xl6yd2QYmqj2UG0=
@@ -23,8 +26,12 @@ github.com/go-chassis/go-chassis
v1.7.4-0.20191029093300-ce79305826f9 h1:IqUVYJ7
github.com/go-chassis/go-chassis v1.7.4-0.20191029093300-ce79305826f9/go.mod
h1:QJGDHyfKjt1gZjMXfdUbl+TJkOcdn7WuZpPjzRWbn+8=
github.com/go-chassis/go-chassis v1.7.4-0.20191031115844-2d2fe55920d0
h1:jgfAkHzGcoq+6OOMihP4z0nFC76C0oWHwru2t2tHN9A=
github.com/go-chassis/go-chassis v1.7.4-0.20191031115844-2d2fe55920d0/go.mod
h1:QJGDHyfKjt1gZjMXfdUbl+TJkOcdn7WuZpPjzRWbn+8=
+github.com/go-chassis/go-chassis v1.7.6
h1:z6DxdoYxOjwQMilxCsl4XsscLzmXCYjOqlBpK2kgrv4=
+github.com/go-chassis/go-chassis v1.7.6/go.mod
h1:AjWYNxGhVZznFNlq+ggHkpVisJahPoDn3iKAJtQZBG0=
github.com/go-chassis/go-chassis-config v0.14.0
h1:OnM9sx2GalDC7vEIhPecRpQlVa8hz10NOB41+9tii5A=
github.com/go-chassis/go-chassis-config v0.14.0/go.mod
h1:qzvK/aoAv0O/khmF6ehW6RgELrF1JR2F555T9izoo2A=
+github.com/go-chassis/go-chassis-config v0.15.0
h1:cTsUl7r3eo2tFoACHADnymwO/5ebb6RVNTj11kxjiZ8=
+github.com/go-chassis/go-chassis-config v0.15.0/go.mod
h1:yuaprnRdObPhYaHVKaocBQPoLfoBFaFmzApM2nRROws=
github.com/go-chassis/go-restful-swagger20 v1.0.1
h1:HdGto0xroWGK504XN0Um7JBc0OPMHDlWwedkd2mTGII=
github.com/go-chassis/go-restful-swagger20 v1.0.1/go.mod
h1:s+06mcAnGsVYQ2sqM4ZPiMJeRj7BTeAM/4gkhZNcsjA=
github.com/go-chassis/go-restful-swagger20
v1.0.2-0.20191029071646-8c0119f661c5
h1:jlUonIaxwdVZrP27t2mPKHDuBz913nXznn4dOtvHzPg=