Skip to content

qhwa/elixir-upyun

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ElixirUpyun

travis-status inch_doc_status

Unofficial Upyun client for Elixir.

warning: This is an unofficial and under development SDK. APIs may change frequently. Do NOT use it in your production.

online documents

Installation

The package can be installed as:

  1. Add upyun to your list of dependencies in mix.exs:

    def deps do
      [{:hlj_upyun, "~> 0.1"}]
    end
  2. Ensure upyun is started before your application:

    def application do
      [applications: [:upyun]]
    end

Usage

Example:

policy = %Upyun{ operator: "USER_NAME", password: "PASSWORD", bucket: "BUCKET" }

# upload a file
policy |> Upyun.upload(local_file_path, "/path/to/remote/file")
#=> :ok

# get file info
policy |> Upyun.info("/path/to/remote/file")

# list entries
policy |> Upyun.list("/")
#=> [{:file, 150, ...}, {:dir, 0, ...}, ...]

# put content to bucket, stores it as a file
policy |> Upyun.put(
  "THIS IS THE CONTENT OF THE FILE",
  "/path/to/remote/file"
)

# get content of the remote file
policy |> Upyun.get("/path/to/remote/file")
#=> "THIS IS THE CONTENT OF THE FILE"

# upload a dir recursively
policy |> Upyun.upload_dir("/path/to/local/dir", "/path/to/remote/dir")

# delete an object of remote
policy |> Upyun.delete("/path/to/remote/object")

License

MIT

Feel free to fork or submit issues.

About

A client SDK of Upyun for Elixir

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages