Skip to content

Commit

Permalink
Merge pull request #77 from tencentyun/feature_willppan_ecd53d1a
Browse files Browse the repository at this point in the history
Feature willppan ecd53d1a
  • Loading branch information
willppan authored Sep 23, 2024
2 parents 992e987 + 3be8ac8 commit 752be27
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 17 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@

## 下载链接

当前版本:v1.0.1
当前版本:v1.0.2

[Linux-386](https://github.com/tencentyun/coscli/releases/download/v1.0.1/coscli-v1.0.1-linux-386)
[Linux-386](https://github.com/tencentyun/coscli/releases/download/v1.0.2/coscli-v1.0.2-linux-386)

[Linux-amd64](https://github.com/tencentyun/coscli/releases/download/v1.0.1/coscli-v1.0.1-linux-amd64)
[Linux-amd64](https://github.com/tencentyun/coscli/releases/download/v1.0.2/coscli-v1.0.2-linux-amd64)

[Linux-arm](https://github.com/tencentyun/coscli/releases/download/v1.0.1/coscli-v1.0.1-linux-arm)
[Linux-arm](https://github.com/tencentyun/coscli/releases/download/v1.0.2/coscli-v1.0.2-linux-arm)

[Linux-arm64](https://github.com/tencentyun/coscli/releases/download/v1.0.1/coscli-v1.0.1-linux-arm64)
[Linux-arm64](https://github.com/tencentyun/coscli/releases/download/v1.0.2/coscli-v1.0.2-linux-arm64)

[Mac-amd64](https://github.com/tencentyun/coscli/releases/download/v1.0.1/coscli-v1.0.1-darwin-amd64)
[Mac-amd64](https://github.com/tencentyun/coscli/releases/download/v1.0.2/coscli-v1.0.2-darwin-amd64)

[Mac-arm64](https://github.com/tencentyun/coscli/releases/download/v1.0.1/coscli-v1.0.1-darwin-arm64)
[Mac-arm64](https://github.com/tencentyun/coscli/releases/download/v1.0.2/coscli-v1.0.2-darwin-arm64)

[Windows-386](https://github.com/tencentyun/coscli/releases/download/v1.0.1/coscli-v1.0.1-windows-386.exe)
[Windows-386](https://github.com/tencentyun/coscli/releases/download/v1.0.2/coscli-v1.0.2-windows-386.exe)

[Windows-amd64](https://github.com/tencentyun/coscli/releases/download/v1.0.1/coscli-v1.0.1-windows-amd64.exe)
[Windows-amd64](https://github.com/tencentyun/coscli/releases/download/v1.0.2/coscli-v1.0.2-windows-amd64.exe)

## 使用方法

Expand Down
3 changes: 3 additions & 0 deletions cmd/cp.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Example:
disableAllSymlink, _ := cmd.Flags().GetBool("disable-all-symlink")
enableSymlinkDir, _ := cmd.Flags().GetBool("enable-symlink-dir")
disableCrc64, _ := cmd.Flags().GetBool("disable-crc64")
disableChecksum, _ := cmd.Flags().GetBool("disable-checksum")

meta, err := util.MetaStringToHeader(metaString)
if err != nil {
Expand Down Expand Up @@ -111,6 +112,7 @@ Example:
DisableAllSymlink: disableAllSymlink,
EnableSymlinkDir: enableSymlinkDir,
DisableCrc64: disableCrc64,
DisableChecksum: disableChecksum,
},
Monitor: &util.FileProcessMonitor{},
Config: &config,
Expand Down Expand Up @@ -254,6 +256,7 @@ func init() {
cpCmd.Flags().Bool("disable-all-symlink", true, "Ignore all symbolic link subfiles and symbolic link subdirectories when uploading, not uploaded by default")
cpCmd.Flags().Bool("enable-symlink-dir", false, "Upload linked subdirectories, not uploaded by default")
cpCmd.Flags().Bool("disable-crc64", false, "Disable CRC64 data validation. By default, coscli enables CRC64 validation for data transfer")
cpCmd.Flags().Bool("disable-checksum", false, "Disable overall CRC64 checksum, only validate fragments")
}

func cosCopy(args []string, recursive bool, include string, exclude string, meta util.Meta, storageClass string) error {
Expand Down
3 changes: 3 additions & 0 deletions cmd/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Example:
disableAllSymlink, _ := cmd.Flags().GetBool("disable-all-symlink")
enableSymlinkDir, _ := cmd.Flags().GetBool("enable-symlink-dir")
disableCrc64, _ := cmd.Flags().GetBool("disable-crc64")
disableChecksum, _ := cmd.Flags().GetBool("disable-checksum")
backupDir, _ := cmd.Flags().GetString("backup-dir")
force, _ := cmd.Flags().GetBool("force")

Expand Down Expand Up @@ -111,6 +112,7 @@ Example:
DisableAllSymlink: disableAllSymlink,
EnableSymlinkDir: enableSymlinkDir,
DisableCrc64: disableCrc64,
DisableChecksum: disableChecksum,
SnapshotPath: snapshotPath,
Delete: delete,
BackupDir: backupDir,
Expand Down Expand Up @@ -291,6 +293,7 @@ func init() {
syncCmd.Flags().Bool("disable-all-symlink", true, "Ignore all symbolic link subfiles and symbolic link subdirectories when uploading, not uploaded by default")
syncCmd.Flags().Bool("enable-symlink-dir", false, "Upload linked subdirectories, not uploaded by default")
syncCmd.Flags().Bool("disable-crc64", false, "Disable CRC64 data validation. By default, coscli enables CRC64 validation for data transfer")
syncCmd.Flags().Bool("disable-checksum", false, "Disable overall CRC64 checksum, only validate fragments")
syncCmd.Flags().String("backup-dir", "", "Synchronize deleted file backups, used to save the destination-side files that have been deleted but do not exist on the source side.")
syncCmd.Flags().Bool("force", false, "Force the operation without prompting for confirmation")
}
2 changes: 1 addition & 1 deletion util/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const (
)

const (
Version string = "v1.0.1"
Version string = "v1.0.2"
Package string = "coscli"
SchemePrefix string = "cos://"
CosSeparator string = "/"
Expand Down
9 changes: 5 additions & 4 deletions util/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,11 @@ func singleDownload(c *cos.Client, fo *FileOperations, objectInfo objectInfoType
XOptionHeader: nil,
XCosTrafficLimit: (int)(fo.Operation.RateLimiting * 1024 * 1024 * 8),
},
PartSize: fo.Operation.PartSize,
ThreadPoolSize: fo.Operation.ThreadNum,
CheckPoint: true,
CheckPointFile: "",
PartSize: fo.Operation.PartSize,
ThreadPoolSize: fo.Operation.ThreadNum,
CheckPoint: true,
CheckPointFile: "",
DisableChecksum: fo.Operation.DisableChecksum,
}
counter := &Counter{TransferSize: 0}
// 未跳过则通过监听更新size(仅需要分块文件的通过sdk监听进度)
Expand Down
1 change: 1 addition & 0 deletions util/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ type Operation struct {
DisableAllSymlink bool
EnableSymlinkDir bool
DisableCrc64 bool
DisableChecksum bool
SnapshotPath string
Delete bool
BackupDir string
Expand Down
7 changes: 4 additions & 3 deletions util/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,10 @@ func SingleUpload(c *cos.Client, fo *FileOperations, file fileInfoType, cosUrl S
XCosTrafficLimit: (int)(fo.Operation.RateLimiting * 1024 * 1024 * 8),
},
},
PartSize: fo.Operation.PartSize,
ThreadPoolSize: fo.Operation.ThreadNum,
CheckPoint: true,
PartSize: fo.Operation.PartSize,
ThreadPoolSize: fo.Operation.ThreadNum,
CheckPoint: true,
DisableChecksum: fo.Operation.DisableChecksum,
}

counter := &Counter{TransferSize: 0}
Expand Down

0 comments on commit 752be27

Please sign in to comment.