Documentation
¶
Index ¶
- type Client
- func (c *Client) DownloadFile(ctx context.Context, url, destPath string, callback ProgressCallback) error
- func (c *Client) DownloadWithAuth(ctx context.Context, url, apiKey, destPath string, expectedSize int64, ...) error
- func (c *Client) Get(ctx context.Context, path string, result interface{}) error
- func (c *Client) GetWithAuth(ctx context.Context, path string, apiKey string, result interface{}) error
- type ProgressCallback
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client HTTP客户端
func (*Client) DownloadFile ¶
func (c *Client) DownloadFile(ctx context.Context, url, destPath string, callback ProgressCallback) error
DownloadFile 下载文件
func (*Client) DownloadWithAuth ¶ added in v1.0.2
func (c *Client) DownloadWithAuth(ctx context.Context, url, apiKey, destPath string, expectedSize int64, callback ProgressCallback) error
DownloadWithAuth 带认证的下载文件
type ProgressCallback ¶
type ProgressCallback func(downloaded, total int64)
ProgressCallback 下载进度回调函数类型
Click to show internal directories.
Click to hide internal directories.