cloudex v1.2.2 Cloudex.CloudinaryApi

The live API implementation for Cloudinary uploading

Link to this section Summary

Functions

Deletes an image given a public id

Converts the json result from cloudinary to a %UploadedImage{} struct

Upload either a file or url to cloudinary opts can contain: %{resource_type: "video"} which will cause a video upload to occur. returns {:ok, %UploadedFile{}} containing all the information from cloudinary or {:error, "reason"}

Link to this section Functions

Link to this function

delete(item, opts \\ %{})
delete(String.t(), map()) ::
  {:ok, %Cloudex.DeletedImage{public_id: term()}} | {:error, any()}

Deletes an image given a public id

Link to this function

json_result_to_struct(result, source)
json_result_to_struct(map(), String.t()) :: %Cloudex.UploadedImage{
  bytes: term(),
  context: term(),
  created_at: term(),
  etag: term(),
  format: term(),
  height: term(),
  moderation: term(),
  original_filename: term(),
  phash: term(),
  public_id: term(),
  resource_type: term(),
  secure_url: term(),
  signature: term(),
  source: term(),
  tags: term(),
  type: term(),
  url: term(),
  version: term(),
  width: term()
}

Converts the json result from cloudinary to a %UploadedImage{} struct

Link to this function

upload(item, opts \\ %{})
upload(String.t() | {:ok, String.t()}, map()) ::
  {:ok, Cloudex.UploadedImage.t()} | {:error, any()}

Upload either a file or url to cloudinary opts can contain: %{resource_type: "video"} which will cause a video upload to occur. returns {:ok, %UploadedFile{}} containing all the information from cloudinary or {:error, "reason"}

Link to this function

url(resource_type)