oss

command module
Version: v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

README

OSS upload CLI tool

This is a CLI tool for upload files to OSS, now support Aliyun only

Quick start

  • Install
go get github.com/helloworlde/oss
  • Config

Add configuration file in $HOME/.oss.yaml like this:

aliyun:
  accessKeyId: YOUR_AK
  accessSecretId: YOUR_SK
  oss:
    endPoint: YOUR_ENDPOINT
    bucketName: YOUR_BUCKET
    host: YOUR_HOST
    picturePath: /picture

For more convenient upload picture to OSS, so there have an picturePath config

Example

  • Upload file
oss upload file.zip

And then will print url after success like below:

Transfer Rate:100% TotalSize: 2M FinishedSize: 2M
file.zip https://hellowoodes.oss-cn-beijing.aliyuncs.com/file.zip
  • Upload file to specify directory

Just add -d directory when upload

oss upload file.zip -d archive/file/zip
  • Upload picture to picture dicrectory

Just add -p for upload to picture directory

oss upload hello.jpg -p
  • Print as Markdown format when upload picture

Just add -m for print in Markdown format

oss upload hello.jpg -p -m
Transfer Rate:100% TotalSize: 0.20K FinishedSize: 0.20K
![hello.jpg](https://hellowoodes.oss-cn-beijing.aliyuncs.com/picture/hello.jpg)
  • Upload folder

Upload folder is also support

oss upload .idea/ -d idea

Document

How to create a CLI tool

Documentation

Overview

Copyright © 2019 HelloWoodes <hellowoodes@gmail.com>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL