Skip to content

losingle/qcloud-cos-sdk

 
 

Repository files navigation

Qcloud COS

It's the full featured Ruby SDK for Qcloud COS(Cloud Object Service).

We keep API simple but powerful, to give you more freedom.

Enjoy it!

Installation

Add this line to your application's Gemfile:

gem 'qcloud_cos'

And then execute:

$ bundle

Or install it yourself as:

$ gem install qcloud_cos

Usage

QcloudCos.configure do |config|
  config.app_id = 'app-id'
  config.secret_id = 'secret_id'
  config.secret_key = 'secret_key'
  config.region = "ap-guangzhou"
  config.bucket = "default-bucket-name"
end

QcloudCos.list # 列出 / 目录下的文件和文件夹

QcloudCos.upload('/test.log', 'Hello World')
QcloudCos.upload('/test.log', File.new('path/to/log'))

QcloudCos.upload_slice('/video.mp4', 'path/to/video.mp4')

QcloudCos.create_folder('/test/') # 创建目录

CLI

$ qcloud-cos config

$ qcloud-cos info
$ qcloud-cos list

More Example and Scenario, visit our Document

Document

Here is original Restful API, It has the most detailed and authoritative explanation for every API.

Here is our RDoc Document, It's well format to help you find more detail about methods.

Here are some more guides for help you. Welcome to advice.

Test

We use minitest for test and rubocop for Syntax checker, If you want to make contribute to this library. Confirm below Command is success:

bundle exec rake test

Authors && Contributors

License

licensed under the Apache License 2.0

About

Ruby SDK for Qcloud COS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 99.7%
  • Shell 0.3%