注意:文档不详细,因为项目比较忙,暂时先写这么多
If available in Hex, the package can be installed
by adding qcloud
to your list of dependencies in mix.exs
:
## step 1 -> mix.exs
def deps do
[
{:qcloud, "~> 0.1"}
]
end
## step 2
mix deps.get
## step 3 -> config/xxx.exs
config :qcloud, :apps,
hello_world: %{ # your app name
cos: %{
app_id: "xxx", # your config
host: "xxx", # your config
bucket: "xxx", # your config
secret_id: "xxx", # your config
secret_key: "xxx" # your config
}
}
## step 4 for use
### eg.
QCloud.COS.get_object(:hello_world, "files/helloworld.jpg")
QCloud.COS.put_object(:hello_world, file, "image/jpeg", "files/helloworld.jpg")
QCloud.COS.delete_object(:hello_world, "files/helloworld.jpg")
QCloud.COS.head_object(:hello_world, "files/helloworld.jpg")
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/qcloud.