Skip to content

Commit b4b7ed1

Browse files
lvan100lianghuan
authored andcommitted
111
1 parent c2b19eb commit b4b7ed1

File tree

6 files changed

+8
-66
lines changed

6 files changed

+8
-66
lines changed

gen/generator/golang/client/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55
"net/http"
66

7-
"github.com/lvan100/httputil"
7+
"github.com/lvan100/golib/httputil"
88
)
99

1010
// ClientInterface 通过接口实现中间件机制
@@ -20,7 +20,7 @@ type Client struct {
2020
// NewClient 使用默认方案创建客户端
2121
func NewClient(config map[string]any) *Client {
2222
return &Client{&ClientImpl{
23-
Client: &httputil.DefaultHTTPClient{
23+
Client: &httputil.DefaultClient{
2424
Client: http.DefaultClient,
2525
},
2626
}}

gen/generator/golang/client/client_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import (
88
"testing"
99
"time"
1010

11-
"github.com/lvan100/httputil"
11+
"github.com/lvan100/golib/httputil"
1212
)
1313

1414
func TestClient(t *testing.T) {
1515
c := &Client{&ClientImpl{
16-
Client: &httputil.DefaultHTTPClient{
16+
Client: &httputil.DefaultClient{
1717
Client: http.DefaultClient,
1818
Scheme: "http",
1919
Host: "127.0.0.1:9090",

gen/generator/golang/client/impl.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import (
55
"fmt"
66
"net/http"
77

8-
"github.com/lvan100/httputil"
8+
"github.com/lvan100/golib/httputil"
99
)
1010

1111
// ClientImpl 实现最终请求的 client 封装。
1212
type ClientImpl struct {
13-
Client httputil.HTTPClient
13+
Client httputil.Client
1414
}
1515

1616
func (c *ClientImpl) Ping(ctx context.Context, req *PingReq) (*http.Response, *PingResp, error) {

gen/testdata/manager/go/proto/client.go

Lines changed: 0 additions & 27 deletions
This file was deleted.

gen/testdata/manager/go/proto/client_impl.go

Lines changed: 0 additions & 31 deletions
This file was deleted.

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/antlr4-go/antlr/v4 v4.13.1
77
github.com/go-playground/form/v4 v4.2.1
88
github.com/lvan100/errutil v0.0.1
9-
github.com/lvan100/httputil v0.0.0-00010101000000-000000000000
9+
github.com/lvan100/golib v0.0.0
1010
github.com/spf13/cobra v1.9.1
1111
)
1212

@@ -16,4 +16,4 @@ require (
1616
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
1717
)
1818

19-
replace github.com/lvan100/httputil => /Users/didi/httputil
19+
replace github.com/lvan100/golib => /Users/didi/golib

0 commit comments

Comments
 (0)