Skip to content

Commit

Permalink
Merge branch 'master' of YangSen-qn:qiniu/qshell into release
Browse files Browse the repository at this point in the history
  • Loading branch information
YangSen-qn committed Dec 29, 2023
2 parents c6913c8 + c4c2a87 commit 9b1b9f7
Show file tree
Hide file tree
Showing 73 changed files with 614 additions and 252 deletions.
33 changes: 26 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
on:
release:
types: [published,edited]
on:
release:
types: [published]
env:
CGO_ENABLED: 0

name: Release qshell
jobs:
releases-matrix:
Expand All @@ -12,6 +11,7 @@ jobs:
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
strategy:
max-parallel: 1
matrix:
include:
# macOS targets
Expand Down Expand Up @@ -53,9 +53,16 @@ jobs:
- uses: actions/checkout@v2
- name: Set APP_VERSION env
run: echo ::set-env name=APP_VERSION::$(cat ${GITHUB_EVENT_PATH} | jq -r .release.tag_name )
- name: Environment Printer
uses: managedkaos/[email protected]

- name: Prepare qshell
run: |
set -e
wget -qLO /tmp/qshell-v2.11.0-linux-amd64.tar.gz https://devtools.qiniu.com/qshell-v2.11.0-linux-amd64.tar.gz
tar xf /tmp/qshell-v2.11.0-linux-amd64.tar.gz
rm /tmp/qshell-v2.11.0-linux-amd64.tar.gz
./qshell account -- "$PUBLISH_ACCESS_KEY" "$PUBLISH_SECRET_KEY" default
env:
PUBLISH_ACCESS_KEY: ${{ secrets.PUBLISH_ACCESS_KEY }}
PUBLISH_SECRET_KEY: ${{ secrets.PUBLISH_SECRET_KEY }}
- uses: wangyoucao577/go-release-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -64,3 +71,15 @@ jobs:
goversion: "https://golang.org/dl/go1.20.1.linux-amd64.tar.gz"
ldflags: -X "github.com/qiniu/qshell/v2/iqshell/common/version.version=${{ env.APP_VERSION }}" -extldflags "-static"
project_path: "./main"
retry: '100'
- name: Upload Release Asset to Qiniu
run: |
set -e
cd ./main/build-artifacts-*
FILENAME="qshell-${{ env.APP_VERSION }}-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz"
if [ "${{ matrix.goos }}" = "windows" ]; then
FILENAME="qshell-${{ env.APP_VERSION }}-${{ matrix.goos }}-${{ matrix.goarch }}.zip"
fi
../../qshell rput --resumable-api-v2 --overwrite "$PUBLISH_BUCKET_NAME" "$FILENAME" "$FILENAME"
env:
PUBLISH_BUCKET_NAME: ${{ secrets.PUBLISH_BUCKET_NAME }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ src/test/
src/.qshell
marker.go
marker_test.go
build.sh
build_local.sh

# Folders
_obj
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 2.13.0
## 更新
1. batchstat 和 batchsign 支持结果输出到文件
2. get / qdownload / qdownload2 当指定下载域名则仅使用此域名进行下载
3. rput / qupload / qupload2 支持顺序读


# 2.12.0
## 新增
1. qdownload / qdownload2 / get 下载命令支持使用源站域名进行下载,用户可不对 bucket 绑定域名(qshell 内部自动查询源站域名 ,用户不用设置)
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ qshell 是利用 [七牛文档上公开的 API](http://developer.qiniu.com) 实
| 支持平台 | 链接 |
| ----------------------- | -------------------------------------------------------------------------------------------------- |
| Windows X86 | [下载](https://github.com/qiniu/qshell/releases/download/v2.11.0/qshell-v2.11.0-windows-386.zip) |
| Windows amd64 | [下载](https://github.com/qiniu/qshell/releases/download/v2.11.0/qshell-v2.11.0-windows-amd64.zip) |
| Windows arm | [下载](https://github.com/qiniu/qshell/releases/download/v2.11.0/qshell-v2.11.0-windows-arm.zip) |
| Linux X86 | [下载](https://github.com/qiniu/qshell/releases/download/v2.11.0/qshell-v2.11.0-linux-386.tar.gz) |
| Linux amd64 | [下载](https://github.com/qiniu/qshell/releases/download/v2.11.0/qshell-v2.11.0-linux-amd64.tar.gz) |
| Linux arm | [下载](https://github.com/qiniu/qshell/releases/download/v2.11.0/qshell-v2.11.0-linux-arm.tar.gz) |
| Linux arm64 | [下载](https://github.com/qiniu/qshell/releases/download/v2.11.0/qshell-v2.11.0-linux-arm64.tar.gz) |
| Mac OS(10.12以上) amd64 | [下载](https://github.com/qiniu/qshell/releases/download/v2.11.0/qshell-v2.11.0-darwin-amd64.tar.gz) |
| Mac OS arm64 | [下载](https://github.com/qiniu/qshell/releases/download/v2.11.0/qshell-v2.11.0-darwin-arm64.tar.gz) |
| Windows X86 | [下载](https://github.com/qiniu/qshell/releases/download/v2.13.0/qshell-v2.13.0-windows-386.zip) |
| Windows amd64 | [下载](https://github.com/qiniu/qshell/releases/download/v2.13.0/qshell-v2.13.0-windows-amd64.zip) |
| Windows arm | [下载](https://github.com/qiniu/qshell/releases/download/v2.13.0/qshell-v2.13.0-windows-arm.zip) |
| Linux X86 | [下载](https://github.com/qiniu/qshell/releases/download/v2.13.0/qshell-v2.13.0-linux-386.tar.gz) |
| Linux amd64 | [下载](https://github.com/qiniu/qshell/releases/download/v2.13.0/qshell-v2.13.0-linux-amd64.tar.gz) |
| Linux arm | [下载](https://github.com/qiniu/qshell/releases/download/v2.13.0/qshell-v2.13.0-linux-arm.tar.gz) |
| Linux arm64 | [下载](https://github.com/qiniu/qshell/releases/download/v2.13.0/qshell-v2.13.0-linux-arm64.tar.gz) |
| Mac OS(10.12以上) amd64 | [下载](https://github.com/qiniu/qshell/releases/download/v2.13.0/qshell-v2.13.0-darwin-amd64.tar.gz) |
| Mac OS arm64 | [下载](https://github.com/qiniu/qshell/releases/download/v2.13.0/qshell-v2.13.0-darwin-arm64.tar.gz) |


## 安装
Expand Down
5 changes: 3 additions & 2 deletions cmd/asyncfetch.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package cmd

import (
"github.com/spf13/cobra"

"github.com/qiniu/qshell/v2/docs"
"github.com/qiniu/qshell/v2/iqshell"
"github.com/qiniu/qshell/v2/iqshell/storage/object/operations"
"github.com/spf13/cobra"
)

func asyncFetchCmdBuilder(cfg *iqshell.Config) *cobra.Command {
Expand Down Expand Up @@ -32,7 +33,7 @@ func asyncFetchCmdBuilder(cfg *iqshell.Config) *cobra.Command {
cmd.Flags().StringVarP(&info.CallbackBody, "callback-body", "b", "", "callback body")
cmd.Flags().StringVarP(&info.CallbackHost, "callback-host", "T", "", "callback HOST")

cmd.Flags().IntVarP(&info.FileType, "file-type", "", 0, "storage type, 0:STANDARD storage, 1:IA storage, 2:ARCHIVE storage, 3:DEEP_ARCHIVE storage")
cmd.Flags().IntVarP(&info.FileType, "file-type", "", 0, "storage type, 0:STANDARD storage, 1:IA storage, 2:ARCHIVE storage, 3:DEEP_ARCHIVE storage, 4:ARCHIVE_IR storage")
cmd.Flags().IntVarP(&info.FileType, "storage-type", "g", 0, "storage type, same to --file-type")
_ = cmd.Flags().MarkDeprecated("storage-type", "use --file-type instead") // 废弃 storage-type

Expand Down
5 changes: 3 additions & 2 deletions cmd/bucket.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package cmd

import (
"github.com/spf13/cobra"

"github.com/qiniu/qshell/v2/docs"
"github.com/qiniu/qshell/v2/iqshell"
"github.com/qiniu/qshell/v2/iqshell/common/data"
"github.com/qiniu/qshell/v2/iqshell/storage/bucket/operations"
"github.com/spf13/cobra"
)

var domainsCmdBuilder = func(cfg *iqshell.Config) *cobra.Command {
Expand Down Expand Up @@ -136,7 +137,7 @@ var listBucketCmd2Builder = func(cfg *iqshell.Config) *cobra.Command {
cmd.Flags().StringVarP(&info.StartDate, "start", "s", "", "start date with format yyyy-mm-dd-hh-MM-ss, all files will be listed according to the prefix and then filtered.")
cmd.Flags().StringVarP(&info.EndDate, "end", "e", "", "end date with format yyyy-mm-dd-hh-MM-ss, all files will be listed according to the prefix and then filtered.")

cmd.Flags().StringVarP(&info.FileTypes, "file-types", "", "", "Specify storage type, separated by comma, all files will be listed according to the prefix and then filtered. 0:STANDARD storage, 1:IA storage, 2 means ARCHIVE storage. 3:DEEP_ARCHIVE storage")
cmd.Flags().StringVarP(&info.FileTypes, "file-types", "", "", "Specify storage type, separated by comma, all files will be listed according to the prefix and then filtered. 0:STANDARD storage, 1:IA storage, 2:ARCHIVE storage, 3:DEEP_ARCHIVE storage 4:ARCHIVE_IR storage")
cmd.Flags().StringVarP(&info.FileTypes, "storages", "", "", "Specify storage type, same to --file-types")
_ = cmd.Flags().MarkDeprecated("storages", "use --file-types instead") // 废弃 storages

Expand Down
6 changes: 4 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ package cmd

import (
"fmt"
"os"

"github.com/spf13/cobra"

"github.com/qiniu/qshell/v2/docs"
"github.com/qiniu/qshell/v2/iqshell"
"github.com/qiniu/qshell/v2/iqshell/common/config"
"github.com/qiniu/qshell/v2/iqshell/common/data"
"github.com/qiniu/qshell/v2/iqshell/common/version"
"github.com/spf13/cobra"
"os"
)

const (
Expand Down
11 changes: 7 additions & 4 deletions cmd/rs.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package cmd

import (
"github.com/spf13/cobra"

"github.com/qiniu/qshell/v2/docs"
"github.com/qiniu/qshell/v2/iqshell"
"github.com/qiniu/qshell/v2/iqshell/storage/object/operations"
"github.com/spf13/cobra"
)

var statCmdBuilder = func(cfg *iqshell.Config) *cobra.Command {
Expand Down Expand Up @@ -88,8 +89,9 @@ var changeLifecycleCmdBuilder = func(cfg *iqshell.Config) *cobra.Command {
},
}
cmd.Flags().IntVarP(&info.ToIAAfterDays, "to-ia-after-days", "", 0, "to IA storage after some days. the range is -1 or bigger than 0. -1 means cancel to IA storage")
cmd.Flags().IntVarP(&info.ToArchiveAfterDays, "to-archive-after-days", "", 0, "to archive storage after some days. the range is -1 or bigger than 0. -1 means cancel to archive storage")
cmd.Flags().IntVarP(&info.ToDeepArchiveAfterDays, "to-deep-archive-after-days", "", 0, "to deep archive storage after some days. the range is -1 or bigger than 0. -1 means cancel to deep archive storage")
cmd.Flags().IntVarP(&info.ToArchiveIRAfterDays, "to-archive-ir-after-days", "", 0, "to ARCHIVE_IR storage after some days. the range is -1 or bigger than 0. -1 means cancel to ARCHIVE_IR storage")
cmd.Flags().IntVarP(&info.ToArchiveAfterDays, "to-archive-after-days", "", 0, "to ARCHIVE storage after some days. the range is -1 or bigger than 0. -1 means cancel to ARCHIVE storage")
cmd.Flags().IntVarP(&info.ToDeepArchiveAfterDays, "to-deep-archive-after-days", "", 0, "to DEEP_ARCHIVE storage after some days. the range is -1 or bigger than 0. -1 means cancel to DEEP_ARCHIVE storage")
cmd.Flags().IntVarP(&info.DeleteAfterDays, "delete-after-days", "", 0, "delete after some days. the range is -1 or bigger than 0. -1 means cancel to delete")
return cmd
}
Expand Down Expand Up @@ -242,7 +244,8 @@ var changeTypeCmdBuilder = func(cfg *iqshell.Config) *cobra.Command {
And 0 means STANDARD storage,
while 1 means IA storage,
while 2 means ARCHIVE storage.
while 3 means DEEP_ARCHIVE storage.`,
while 3 means DEEP_ARCHIVE storage.
while 4 means ARCHIVE_IR storage.`,
Example: `change storage type of A.png(bucket:bucketA key:A.png) to ARCHIVE storage
qshell chtype bucketA A.png 2
and you can check result by command:
Expand Down
13 changes: 10 additions & 3 deletions cmd/rsbatch.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package cmd

import (
"github.com/spf13/cobra"

"github.com/qiniu/qshell/v2/docs"
"github.com/qiniu/qshell/v2/iqshell"
"github.com/qiniu/qshell/v2/iqshell/storage/object/batch"
"github.com/qiniu/qshell/v2/iqshell/storage/object/operations"
"github.com/spf13/cobra"
)

var batchStatCmdBuilder = func(cfg *iqshell.Config) *cobra.Command {
Expand All @@ -28,6 +29,7 @@ var batchStatCmdBuilder = func(cfg *iqshell.Config) *cobra.Command {
setBatchCmdWorkerCountIncreasePeriodFlags(cmd, &info.BatchInfo)
setBatchCmdSuccessExportFileFlags(cmd, &info.BatchInfo)
setBatchCmdFailExportFileFlags(cmd, &info.BatchInfo)
setBatchCmdResultExportFileFlags(cmd, &info.BatchInfo)
setBatchCmdForceFlags(cmd, &info.BatchInfo)
setBatchCmdEnableRecordFlags(cmd, &info.BatchInfo)
setBatchCmdRecordRedoWhileErrorFlags(cmd, &info.BatchInfo)
Expand Down Expand Up @@ -174,8 +176,9 @@ Lifecycle value must great than or equal to -1, unit: day.
},
}
cmd.Flags().IntVarP(&info.ToIAAfterDays, "to-ia-after-days", "", 0, "to IA storage after some days. the range is -1 or bigger than 0. -1 means cancel to IA storage")
cmd.Flags().IntVarP(&info.ToArchiveAfterDays, "to-archive-after-days", "", 0, "to archive storage after some days. the range is -1 or bigger than 0. -1 means cancel to archive storage")
cmd.Flags().IntVarP(&info.ToDeepArchiveAfterDays, "to-deep-archive-after-days", "", 0, "to deep archive storage after some days. the range is -1 or bigger than 0. -1 means cancel to deep archive storage")
cmd.Flags().IntVarP(&info.ToArchiveIRAfterDays, "to-archive-ir-after-days", "", 0, "to ARCHIVE_IR storage after some days. the range is -1 or bigger than 0. -1 means cancel to ARCHIVE_IR storage")
cmd.Flags().IntVarP(&info.ToArchiveAfterDays, "to-archive-after-days", "", 0, "to ARCHIVE storage after some days. the range is -1 or bigger than 0. -1 means cancel to ARCHIVE storage")
cmd.Flags().IntVarP(&info.ToDeepArchiveAfterDays, "to-deep-archive-after-days", "", 0, "to DEEP_ARCHIVE storage after some days. the range is -1 or bigger than 0. -1 means cancel to DEEP_ARCHIVE storage")
cmd.Flags().IntVarP(&info.DeleteAfterDays, "delete-after-days", "", 0, "delete after some days. the range is -1 or bigger than 0. -1 means cancel to delete")
setBatchCmdDefaultFlags(cmd, &info.BatchInfo)
return cmd
Expand Down Expand Up @@ -257,6 +260,7 @@ var batchSignCmdBuilder = func(cfg *iqshell.Config) *cobra.Command {
},
}
setBatchCmdInputFileFlags(cmd, &info.BatchInfo)
setBatchCmdResultExportFileFlags(cmd, &info.BatchInfo)
setBatchCmdEnableRecordFlags(cmd, &info.BatchInfo)
setBatchCmdRecordRedoWhileErrorFlags(cmd, &info.BatchInfo)
cmd.Flags().StringVarP(&info.Deadline, "deadline", "e", "3600", "deadline in seconds, default 3600")
Expand Down Expand Up @@ -340,6 +344,9 @@ func setBatchCmdOverwriteFlags(cmd *cobra.Command, info *batch.Info) {
cmd.Flags().BoolVarP(&info.Overwrite, "overwrite", "w", false, "overwrite mode")
_ = cmd.Flags().MarkShorthandDeprecated("overwrite", "deprecated and use --overwrite instead")
}
func setBatchCmdResultExportFileFlags(cmd *cobra.Command, info *batch.Info) {
cmd.Flags().StringVarP(&info.ResultExportFilePath, "outfile", "o", "", "specifies the file path where the results is saved")
}

func init() {
registerLoader(rsBatchCmdLoader)
Expand Down
13 changes: 8 additions & 5 deletions cmd/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package cmd

import (
"github.com/qiniu/go-sdk/v7/storage"
"github.com/spf13/cobra"

"github.com/qiniu/qshell/v2/docs"
"github.com/qiniu/qshell/v2/iqshell"
"github.com/qiniu/qshell/v2/iqshell/common/config"
"github.com/qiniu/qshell/v2/iqshell/common/data"
"github.com/qiniu/qshell/v2/iqshell/storage/object/upload/operations"
"github.com/spf13/cobra"
)

var uploadCmdBuilder = func(cfg *iqshell.Config) *cobra.Command {
Expand Down Expand Up @@ -71,6 +72,7 @@ var upload2CmdBuilder = func(cfg *iqshell.Config) *cobra.Command {
cmd.Flags().StringVarP(&info.OverwriteExportFilePath, "overwrite-list", "w", "", "upload success (overwrite) file list")
cmd.Flags().IntVar(&info.Info.WorkerCount, "thread-count", 1, "multiple thread count")
cmd.Flags().IntVar(&info.UploadConfig.WorkerCount, "worker-count", 3, "the number of concurrently uploaded parts of a single file in resumable upload")
cmd.Flags().BoolVar(&info.UploadConfig.SequentialReadFile, "sequential-read-file", false, "File reading is sequential and does not involve skipping; when enabled, the uploading fragment data will be loaded into the memory. This option may increase file upload speed for mounted network filesystems.")

cmd.Flags().BoolVarP(&info.ResumableAPIV2, "resumable-api-v2", "", false, "use resumable upload v2 APIs to upload")
cmd.Flags().Int64Var(&info.ResumableAPIV2PartSize, "resumable-api-v2-part-size", data.BLOCK_SIZE, "the part size when use resumable upload v2 APIs to upload")
Expand All @@ -96,7 +98,7 @@ var upload2CmdBuilder = func(cfg *iqshell.Config) *cobra.Command {
cmd.Flags().StringVar(&LogLevel, "log-level", "debug", "log level")
cmd.Flags().IntVar(&LogRotate, "log-rotate", 7, "log rotate days")

cmd.Flags().IntVarP(&info.FileType, "file-type", "", 0, "set storage type of file, 0:STANDARD storage, 1:IA storage, 2:ARCHIVE storage, 3:DEEP_ARCHIVE storage")
cmd.Flags().IntVarP(&info.FileType, "file-type", "", 0, "set storage type of file, 0:STANDARD storage, 1:IA storage, 2:ARCHIVE storage, 3:DEEP_ARCHIVE storage, 4:ARCHIVE_IR storage")
cmd.Flags().IntVarP(&info.FileType, "storage", "", 0, "set storage type of file, same to --file-type")
_ = cmd.Flags().MarkDeprecated("storage", "use --file-type instead") // 废弃 storage

Expand Down Expand Up @@ -133,7 +135,7 @@ var syncCmdBuilder = func(cfg *iqshell.Config) *cobra.Command {
cmd.Flags().Int64VarP(&info.ChunkSize, "resumable-api-v2-part-size", "", data.BLOCK_SIZE, "the part size when use resumable upload v2 APIs to upload, default 4M")
cmd.Flags().StringVarP(&info.UpHost, "up-host", "u", "", "upload host")

cmd.Flags().IntVarP(&info.FileType, "file-type", "", 0, "set storage type of file, 0:STANDARD storage, 1:IA storage, 2:ARCHIVE storage, 3:DEEP_ARCHIVE storage")
cmd.Flags().IntVarP(&info.FileType, "file-type", "", 0, "set storage type of file, 0:STANDARD storage, 1:IA storage, 2:ARCHIVE storage, 3:DEEP_ARCHIVE storage, 4:ARCHIVE_IR storage")
cmd.Flags().IntVarP(&info.FileType, "storage", "s", 0, "set storage type of file, same to --file-type")
_ = cmd.Flags().MarkDeprecated("storage", "use --file-type instead") // 废弃 storage

Expand Down Expand Up @@ -167,7 +169,7 @@ var formUploadCmdBuilder = func(cfg *iqshell.Config) *cobra.Command {
cmd.Flags().BoolVarP(&info.Overwrite, "overwrite", "", false, "overwrite the file of same key in bucket")
cmd.Flags().StringVarP(&info.MimeType, "mimetype", "t", "", "file mime type")

cmd.Flags().IntVarP(&info.FileType, "file-type", "", 0, "set storage type of file, 0:STANDARD storage, 1:IA storage, 2:ARCHIVE storage, 3:DEEP_ARCHIVE storage")
cmd.Flags().IntVarP(&info.FileType, "file-type", "", 0, "set storage type of file, 0:STANDARD storage, 1:IA storage, 2:ARCHIVE storage, 3:DEEP_ARCHIVE storage, 4:ARCHIVE_IR storage")
cmd.Flags().IntVarP(&info.FileType, "storage", "s", 0, "set storage type of file, same to --file-type")
_ = cmd.Flags().MarkDeprecated("storage", "use --file-type instead") // 废弃 storage

Expand Down Expand Up @@ -203,12 +205,13 @@ var resumeUploadCmdBuilder = func(cfg *iqshell.Config) *cobra.Command {
cmd.Flags().StringVarP(&info.MimeType, "mimetype", "t", "", "file mime type")
cmd.Flags().BoolVarP(&info.Overwrite, "overwrite", "", false, "overwrite the file of same key in bucket")
cmd.Flags().BoolVarP(&info.UseResumeV2, "resumable-api-v2", "", false, "use resumable upload v2 APIs to upload")
cmd.Flags().BoolVar(&info.SequentialReadFile, "sequential-read-file", false, "File reading is sequential and does not involve skipping; when enabled, the uploading fragment data will be loaded into the memory. This option may increase file upload speed for mounted network filesystems.")

cmd.Flags().Int64VarP(&info.ChunkSize, "resumable-api-v2-part-size", "", data.BLOCK_SIZE, "the part size when use resumable upload v2 APIs to upload, default 4M")
cmd.Flags().Int64VarP(&info.ChunkSize, "v2-part-size", "", data.BLOCK_SIZE, "the part size when use resumable upload v2 APIs to upload, same to --resumable-api-v2-part-size")
_ = cmd.Flags().MarkDeprecated("v2-part-size", "use --resumable-api-v2-part-size instead")

cmd.Flags().IntVarP(&info.FileType, "file-type", "", 0, "set storage type of file, 0:STANDARD storage, 1:IA storage, 2:ARCHIVE storage, 3:DEEP_ARCHIVE storage")
cmd.Flags().IntVarP(&info.FileType, "file-type", "", 0, "set storage type of file, 0:STANDARD storage, 1:IA storage, 2:ARCHIVE storage, 3:DEEP_ARCHIVE storage, 4:ARCHIVE_IR storage")
cmd.Flags().IntVarP(&info.FileType, "storage", "s", 0, "set storage type of file, same to --file-type")
_ = cmd.Flags().MarkDeprecated("storage", "use --file-type instead") // 废弃 storage

Expand Down
3 changes: 2 additions & 1 deletion cmd_test/aa_pre_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ package cmd

import (
"fmt"
"testing"

"github.com/qiniu/qshell/v2/cmd_test/test"
"github.com/qiniu/qshell/v2/iqshell/common/data"
"testing"
)

func TestCmd(t *testing.T) {
Expand Down
4 changes: 3 additions & 1 deletion cmd_test/async_fetch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package cmd

import (
"github.com/qiniu/qshell/v2/cmd_test/test"
"github.com/qiniu/qshell/v2/iqshell/common/utils"

"strings"
"testing"
)
Expand All @@ -15,7 +17,7 @@ func TestAsyncFetch(t *testing.T) {
fetchKeys = append(fetchKeys, "hello10.json")
content := ""
for _, key := range fetchKeys {
content += "http://" + test.BucketDomain + "/" + key + "\t" + "0" + "\t" + "fetch_" + key + "\n"
content += utils.Endpoint(false, test.BucketDomain) + "/" + key + "\t" + "0" + "\t" + "fetch_" + key + "\n"
}
path, err := test.CreateFileWithContent("async_fetch.txt", content)
if err != nil {
Expand Down
Loading

0 comments on commit 9b1b9f7

Please sign in to comment.