Skip to content

ug0/aliyun_oss

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AliyunOss

Build Status Hex.pm

阿里云对象存储(OSS)API

Installation

Add aliyun_oss to your list of dependencies in mix.exs:

def deps do
  [
    {:aliyun_oss, "~> 2.0"}
  ]
end

Usage

defmodule MyApp.Oss do
  alias Aliyun.Oss.Config
  alias Aliyun.Oss.Bucket

  def list_buckets(query_params \\ %{}) do
    Bucket.list_buckets(config(), query_params)
  end

  # encapsulate more API that you required ...

  def config() do
    :my_app
    |> Application.fetch_env!(MyApp.Oss)
    |> Config.new!()
  end
end

# In the config/runtime.exs
config :my_app, MyApp.Oss,
  endpoint: "...",
  access_key_id: "...",
  access_key_secret: "..."

Documentation

https://hexdocs.pm/aliyun_oss

API List

更多请参考阿里云官方文档

License

MIT