Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: "cloud-station-cli", Long: "cloud-station-cli 云中转站", Short: "cloud-station-cli 云中转站", Example: "cloud-station-cli cmds", RunE: func(cmd *cobra.Command, args []string) error { if version { fmt.Println("cloud-station-cli v0.0.1") } return nil }, }
View Source
var UploadCmd = &cobra.Command{ Use: "upload", Long: "upload 文件上传", Short: "upload 文件上传", Example: "upload -f filename", RunE: func(cmd *cobra.Command, args []string) error { var ( uploader store.Uploader err error ) switch ossProvier { case "aliyun": aliOpts := &aliyun.Options{ Endpoint: ossEndpoint, AccessKey: accessKey, AccessSecret: accessSecret, } setAliDefault(aliOpts) uploader, err = aliyun.NewAliOssStore(aliOpts) case "tx": uploader = tx.NewTxOssStore() case "aws": uploader = aws.NewAwsOssStore() default: return fmt.Errorf("not support oss storage provider") } if err != nil { return err } return uploader.Upload(bucketName, uploadFile, uploadFile) }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.