Skip to content

Commit 6102362

Browse files
authored
Merge pull request #219 from qiniu/develop
add comment to exported symbol
2 parents 9298662 + 9b64c8a commit 6102362

23 files changed

+145
-31
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# 2.3.6
22
1. 修复m3u8replace 上传的问题
3+
2. 加入reportCard检测代码质量
34

45
# 2.3.5
56
1. 增加token命令,创建Qbox token, qiniuToken, uploadToken

cmd/account.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ var cmdAccount = &cobra.Command{
2828
Run: Account,
2929
}
3030

31+
// 【account】获取本地保存的用户的AK/AK/Name信息; 设置保存用户AK/SK信息到本地
3132
func Account(cmd *cobra.Command, params []string) {
3233
if len(params) == 0 {
3334
account, gErr := iqshell.GetAccount()

cmd/alilistbucket.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ func init() {
1717
RootCmd.AddCommand(aliCmd)
1818
}
1919

20+
// 【alilistbucket】列举阿里空间中的文件列表
2021
func AliListBucket(cmd *cobra.Command, params []string) {
2122
dataCenter := params[0]
2223
bucket := params[1]

cmd/bucket.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ func init() {
3131
RootCmd.AddCommand(bucketsCmd, domainsCmd)
3232
}
3333

34+
// 【buckets】获取一个用户的所有的存储空间
3435
func GetBuckets(cmd *cobra.Command, params []string) {
3536

3637
bm := iqshell.GetBucketManager()
@@ -49,6 +50,7 @@ func GetBuckets(cmd *cobra.Command, params []string) {
4950
}
5051
}
5152

53+
// 【domains】获取一个空间绑定的CDN域名
5254
func GetDomainsOfBucket(cmd *cobra.Command, params []string) {
5355
bucket := params[0]
5456
bm := iqshell.GetBucketManager()

cmd/cdn.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,14 @@ import (
1212
)
1313

1414
const (
15+
// CDN刷新一次性最大的刷新文件列表
1516
BATCH_CDN_REFRESH_URLS_ALLOW_MAX = 100
17+
18+
// CDN目录刷新一次性最大的刷新目录数
1619
BATCH_CDN_REFRESH_DIRS_ALLOW_MAX = 10
17-
BATCH_CDN_PREFETCH_ALLOW_MAX = 100
20+
21+
// 预取一次最大的预取数目
22+
BATCH_CDN_PREFETCH_ALLOW_MAX = 100
1823
)
1924

2025
var (
@@ -46,7 +51,7 @@ func init() {
4651
RootCmd.AddCommand(cdnPreCmd, cdnRefreshCmd)
4752
}
4853

49-
// 刷新CDN
54+
// 【cdnrefresh】刷新所有CDN节点
5055
func CdnRefresh(cmd *cobra.Command, params []string) {
5156
var urlListFile string
5257

@@ -123,7 +128,7 @@ func cdnRefresh(cm *cdn.CdnManager, urls []string, dirs []string) {
123128
}
124129
}
125130

126-
// CDN 文件预取
131+
// 【cdnprefetch】CDN 文件预取
127132
func CdnPrefetch(cmd *cobra.Command, params []string) {
128133
var urlListFile string
129134

cmd/fop.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ func init() {
3030
RootCmd.AddCommand(prefopCmd, fopCmd)
3131
}
3232

33+
// 【prefop】根据persistentId查询异步处理的进度, 处理结果
3334
func Prefop(cmd *cobra.Command, params []string) {
3435
persistentId := params[0]
3536

@@ -42,6 +43,7 @@ func Prefop(cmd *cobra.Command, params []string) {
4243
}
4344
}
4445

46+
// 【pfop】 提交异步处理请求
4547
func Fop(cmd *cobra.Command, params []string) {
4648
bucket, key, fops := params[0], params[1], params[2]
4749

cmd/ip.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ import (
1010
)
1111

1212
const (
13+
// IP信息查询接口地址
1314
TAOBAO_IP_QUERY = "http://ip.taobao.com/service/getIpInfo.php"
1415
)
1516

17+
// 接口返回的IP信息
1618
type IpInfo struct {
1719
Code int `json:"code"`
1820
Data IpData `json:"data"`
@@ -22,6 +24,7 @@ func (this IpInfo) String() string {
2224
return fmt.Sprintf("%s", this.Data)
2325
}
2426

27+
// ip 具体的信息
2528
type IpData struct {
2629
Country string `json:"country"`
2730
CountryId string `json:"country_id"`
@@ -54,6 +57,7 @@ func init() {
5457
RootCmd.AddCommand(ipQueryCmd)
5558
}
5659

60+
// 【ip】查询ip的相关信息
5761
func IpQuery(cmd *cobra.Command, params []string) {
5862
for _, ip := range params {
5963
url := fmt.Sprintf("%s?ip=%s", TAOBAO_IP_QUERY, ip)

cmd/putfile.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,15 @@ func init() {
6262
RootCmd.AddCommand(formPutCmd, RePutCmd)
6363
}
6464

65+
// 上传接口返回的文件信息
6566
type PutRet struct {
6667
Key string `json:"key"`
6768
Hash string `json:"hash"`
6869
MimeType string `json:"mimeType"`
6970
Fsize int64 `json:"fsize"`
7071
}
7172

73+
// 【fput】使用表单上传本地文件到七牛存储空间
7274
func FormPut(cmd *cobra.Command, params []string) {
7375
bucket := params[0]
7476
key := params[1]
@@ -183,6 +185,8 @@ func FormPut(cmd *cobra.Command, params []string) {
183185
}
184186
}
185187

188+
// 使用分片上传本地文件到七牛存储空间, 一般用于较大文件的上传
189+
// 文件会被分割成4M大小的块, 一块一块地上传文件
186190
func ResumablePut(cmd *cobra.Command, params []string) {
187191
bucket := params[0]
188192
key := params[1]

cmd/qdownload.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
)
1313

1414
var qDownloadCmd = &cobra.Command{
15-
Use: "qdownload [<ThreadCount>] <LocalDownloadConfig>",
15+
Use: "qdownload [-c <ThreadCount>] <LocalDownloadConfig>",
1616
Short: "Batch download files from the qiniu bucket",
1717
Long: "By default qdownload use 5 goroutines to download, it can be customized use -c <count> flag",
1818
Args: cobra.ExactArgs(1),
@@ -29,6 +29,9 @@ func init() {
2929
RootCmd.AddCommand(qDownloadCmd)
3030
}
3131

32+
// 【qdownload】下载七牛存储空间中的文件
33+
// 可以根据文件前缀下载符合要求的所有文件,也可以用户给到要下载的文件名字列表下载文件
34+
// 根据文件列表下载文件功能在文档中还没有公开,遇到有这个需求的客户比较少
3235
func QiniuDownload(cmd *cobra.Command, params []string) {
3336

3437
var downloadConfig iqshell.DownloadConfig

cmd/qupload.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ func parseUploadConfigFile(uploadConfigFile string, uploadConfig *iqshell.Upload
6666
return
6767
}
6868

69-
// upload cmd
69+
// [qupload]命令, 上传本地文件到七牛存储中
70+
// 该命令会读取配置文件, 上传本地文件系统的文件到七牛存储中; 可以设置多线程上传,默认的线程区间在[iqshell.MIN_UPLOAD_THREAD_COUNT, iqshell.MAX_UPLOAD_THREAD_COUNT]
7071
func QiniuUpload(cmd *cobra.Command, params []string) {
7172

7273
configFile := params[0]

0 commit comments

Comments
 (0)