ExOss.StorageTask (ExOss v1.0.0)

Copy Markdown View Source

Storage task struct for file transfer operations.

Location Types

  • {:cloud, bucket, res_key} - Cloud storage
  • {:remote, url} - Remote URL
  • {:file, path} - Local file
  • {:content, binary} - Raw content

Examples

# Upload from URL
%StorageTask{source: {:remote, url}, target: {:cloud, bucket, key}}

# Delete
%StorageTask{source: {:cloud, bucket, key}, target: nil}

# Delete after N days
%StorageTask{source: {:cloud, bucket, key}, target: nil, opts: [days: 7]}

Summary

Types

object()

@type object() ::
  {:cloud, bucket :: binary(), res_key :: binary()}
  | {:remote, url :: binary()}
  | {:file, path :: binary()}
  | {:content, content :: binary()}

t()

@type t() :: %ExOss.StorageTask{
  opts: keyword(),
  policy: term(),
  source: object(),
  target: object() | nil
}