COS

腾讯云对象存储 COS(Cloud Object Storage) Elixir SDK (XML API)

Installation

If available in Hex, the package can be installed by adding tencent_cloud_cos to your list of dependencies in mix.exs:

def deps do
[
{:tencent_cloud_cos, "~> 0.1.0"}
]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/tencent_cloud_cos.

Usage

First, set config:

config :tencent_cloud_cos,
secret_id: "AKIDb************************DmNIJ",
secret_key: "iV1oL**********************4JuFu"

After that, you can upload a file:

iex> COS.Object.put_from_file("https://bucket-1250000000.cos.ap-beijing.myqcloud.com",
"example.txt", "./example.txt")