项目作者: socialpaymentsbv

项目描述 :
Cloudinary client for Elixir
高级语言: Elixir
项目地址: git://github.com/socialpaymentsbv/cloudini.git
创建时间: 2016-05-30T07:42:26Z
项目社区:https://github.com/socialpaymentsbv/cloudini

开源协议:Other

下载


Cloudini

TravisCI

Wrapper client library for Cloudinary API.

For the time being, only image upload and deletion are supported.

Installation

The package can be installed in a following steps:

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

    1. def deps do
    2. [{:cloudini, "~> 1.0"}]
    3. end
  2. Ensure cloudini is started before your application:

    1. def application do
    2. [applications: [:cloudini]]
    3. end
  3. Configure cloudini in config/config.exs:

    1. config :cloudini,
    2. name: "CLOUDINARYNAME",
    3. api_key: "APIKEY",
    4. api_secret: "APISECRET"

Usage

Basic Cloudindary API usage:

  1. client = Cloudini.new
  2. Cloudini.upload_image(client, "fixture/upload/test.gif", public_id: "image_id")
  3. # {:ok, %{"public_id" => "image_id", ...}}
  4. Cloudini.delete_image(client, "image_id")
  5. # {:ok, %{"result" => "ok"}}

Helpers for building URLs:

  • fetch_url(client, "http://picture.from.internet.to.fetch.by.cloudinary.gif")
  • transform_url(client, "http://res.cloudinary.com/...", mode: "fill", width: 200)