Skip to content

Commit dc14791

Browse files
Merge pull request #40 from tianxiaoliang/master
upgrade go chassis version
2 parents bf39bea + 2035bbb commit dc14791

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

example/restaurant/start.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ log_backup_count: 7
3636
EOM
3737

3838
if [ ! -z "$VERSION" ]; then
39-
/bin/echo "Version ENV: $SERVICE_NAME"
39+
/bin/echo "Version ENV: $VERSION"
4040
cat << EOF > ${root_dir}/conf/microservice.yaml
4141
service_description:
4242
name: restaurant

go.mod

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
module github.com/huaweicse/cse-collector
22

33
require (
4-
github.com/go-chassis/foundation v0.0.0-20190621030543-c3b63f787f4c
5-
github.com/go-chassis/go-archaius v0.20.0
6-
github.com/go-chassis/go-chassis v1.7.1
7-
github.com/go-mesh/openlogging v1.0.1-0.20181205082104-3d418c478b2d
4+
github.com/go-chassis/foundation v0.1.0
5+
github.com/go-chassis/go-archaius v0.24.0
6+
github.com/go-chassis/go-chassis v1.7.6
7+
github.com/go-mesh/openlogging v1.0.1
88
github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e // indirect
9-
github.com/huaweicse/auth v1.1.1
10-
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f // indirect
11-
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1 // indirect
12-
github.com/smartystreets/assertions v0.0.0-20190116191733-b6c0e53d7304 // indirect
9+
github.com/huaweicse/auth v1.1.2
1310
)
11+
12+
go 1.13

pkg/monitoring/client.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package monitoring
22

33
import (
4+
"context"
45
"crypto/tls"
56
"encoding/json"
67
"fmt"
@@ -29,12 +30,12 @@ var (
2930
type CseMonitorClient struct {
3031
Header http.Header
3132
URL string
32-
Client *httpclient.URLClient
33+
Client *httpclient.Requests
3334
}
3435

3536
// NewCseMonitorClient creates an new client for monitoring
3637
func NewCseMonitorClient(header http.Header, url string, tlsConfig *tls.Config) (*CseMonitorClient, error) {
37-
c, err := httpclient.GetURLClient(&httpclient.URLClientOption{
38+
c, err := httpclient.New(&httpclient.Options{
3839
SSLEnabled: tlsConfig != nil,
3940
TLSConfig: tlsConfig,
4041
ResponseHeaderTimeout: DefaultTimeout,
@@ -80,7 +81,7 @@ func (cseMonitorClient *CseMonitorClient) PostMetrics(monitorData MonitorData) (
8081
h[k] = v
8182
}
8283

83-
if resp, err = cseMonitorClient.Client.HTTPDo(http.MethodPost, postURL, h, js); err != nil {
84+
if resp, err = cseMonitorClient.Client.Do(context.Background(), http.MethodPost, postURL, h, js); err != nil {
8485
return
8586
}
8687
defer resp.Body.Close()

utils.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func getAuthHeaders() http.Header {
6868
func getMonitorEndpoint() (string, error) {
6969
monitorEndpoint := config.GlobalDefinition.Cse.Monitor.Client.ServerURI
7070
if monitorEndpoint == "" {
71-
monitorURL, err := endpoint.GetEndpointFromServiceCenter("default", "CseMonitoring", "latest")
71+
monitorURL, err := endpoint.GetEndpoint("default", "CseMonitoring", "latest")
7272
if err != nil {
7373
openlogging.GetLogger().Warnf("empty monitor server endpoint, please provide the monitor server endpoint, err: %v", err)
7474
return "", err

0 commit comments

Comments
 (0)