Skip to content

stargwq/tencent_cos

 
 

Repository files navigation

TencentCos

Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file lib/tencent_cos. To experiment with that code, run bin/console for an interactive prompt.

TODO: Delete this and the text above, and describe your gem

Installation

Add this line to your application's Gemfile:

gem 'tencent_cos', git: "https://github.com/jicheng1014/tencent_cos.git"

And then execute:

$ bundle

Usage

###Init client

client = TencentCos::Client.new(
        secret_id: "your secret_id",
        secret_key: "your key",
        app_id: "your app_id",
        region: "Benjing",
        bucket_name: "bucket_name",
        request_retry: 2,
        timeout: 30
    )

###get auth

auth = client.upload_token(params[:key])

###get host

host = client.config.host

###delete object

// bucket&region if empty, value is default config

client.delete_object({
        key: "xxxx",
        bucket: "xxxx",
        region: "xxx"
})

###file exists?

client.key_exists({key: "xxxx",
                   bucket: "xxxx",
                   region: "xxx"})

About

v5 验证版本

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 99.3%
  • Shell 0.7%