-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(iacExtInfo): [116337119] Adjusting the client structure #2544
Conversation
…der-tencentcloud into feat/iacExtInfo2
…der-tencentcloud into feat/iacExtInfo2
…der-tencentcloud into feat/iacExtInfo2
…der-tencentcloud into feat/iacExtInfo2
…der-tencentcloud into feat/iacExtInfo2
.changelog/2544.txt
Outdated
@@ -0,0 +1,3 @@ | |||
```release-note:enhancement | |||
resource/client: Adjusting the client structure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的 changelog 去掉吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已删除
@@ -295,14 +295,28 @@ func (me *TencentCloudClient) UseTencentCosClient(bucket string) *cos.Client { | |||
} | |||
|
|||
// UseMysqlClient returns mysql(cdb) client for service | |||
func (me *TencentCloudClient) UseMysqlClient() *cdb.Client { | |||
func (me *TencentCloudClient) UseMysqlClient(iacExtInfo ...IacExtInfo) *cdb.Client { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里为啥需要使用可变类型的参数呢
iacExtInfoStr = ReqClient | ||
} | ||
|
||
request.Header.Set("X-TC-RequestClient", iacExtInfoStr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里为啥要把 extinfo 塞给 "X-TC-RequestClient" 请求头呢,不应该是把 ReqClient 塞给 "X-TC-RequestClient" 吗
tencentcloud/connectivity/client.go
Outdated
if me.wafConn != nil { | ||
if len(iacExtInfo) != 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为啥这段代码要写 2 次
tencentcloud/connectivity/client.go
Outdated
return me.wafConn | ||
} | ||
|
||
cpf := me.NewClientProfile(300) | ||
cpf.Language = "zh-CN" | ||
me.wafConn, _ = waf.NewClient(me.Credential, me.Region, cpf) | ||
me.wafConn.WithHttpTransport(&LogRoundTripper{}) | ||
if len(iacExtInfo) != 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里应该只需要重新对 LogRoundTripper 赋值就行吧,me.wafConn.WithHttpTransport 的逻辑不用改吧
Co-authored-by: mikatong <[email protected]>
* add * add * fix/bh * fix/bh * fix/bh
* add * add * add * add * add * fix/bh
* add cvm uuid * add changelog
* add * add * add * Update resource_tc_private_dns_record.go
* fix/ckafka * fix/ckafka
* vod update * add changelog && update doc * update * update * update * update review_audio_video_task * update * update * update --------- Co-authored-by: mikatong <[email protected]>
* add eni ipv6 * add eni ipv6 * update doc * update doc * add test * add changelog
* add eni ipv4 * add eni ipv4 * add changelog
* support event config * add changelog --------- Co-authored-by: mikatong <[email protected]>
* Field cluster_subnet_id supports ForceNew * add changelog 2578.txt
* vod update * add changelog --------- Co-authored-by: mikatong <[email protected]>
* fix(mariadb): [116318703] support ip port * feat: add change log * fix: modify test
* feat(tse): [115375235] support tse network access_control * feat: add change log * fix: modify test * fix: modify test
feat/iacExtInfo2