标准化一些注释

This commit is contained in:
GoEdgeLab
2021-04-19 19:29:32 +08:00
parent cf52510399
commit 724f498260
4 changed files with 16 additions and 14 deletions

View File

@@ -5,13 +5,13 @@ import (
"net/http"
)
// HTTP客户端
// HTTPClient HTTP客户端
type HTTPClient struct {
rawClient *http.Client
accessAt int64
}
// 获取新客户端对象
// NewHTTPClient 获取新客户端对象
func NewHTTPClient(rawClient *http.Client) *HTTPClient {
return &HTTPClient{
rawClient: rawClient,
@@ -19,22 +19,22 @@ func NewHTTPClient(rawClient *http.Client) *HTTPClient {
}
}
// 获取原始客户端对象
// RawClient 获取原始客户端对象
func (this *HTTPClient) RawClient() *http.Client {
return this.rawClient
}
// 更新访问时间
// UpdateAccessTime 更新访问时间
func (this *HTTPClient) UpdateAccessTime() {
this.accessAt = utils.UnixTime()
}
// 获取访问时间
// AccessTime 获取访问时间
func (this *HTTPClient) AccessTime() int64 {
return this.accessAt
}
// 关闭
// Close 关闭
func (this *HTTPClient) Close() {
this.rawClient.CloseIdleConnections()
}