FileStorageApi.Container behaviour (file_storage_api v0.4.1)

Module for handling asset containers

Link to this section Summary

Functions

Will create container with binary as input for bucket name

List all files in the container.

Link to this section Types

Specs

options() :: [max_results: non_neg_integer(), marker: String.t()]

Specs

t() :: %FileStorageApi.Container{
  date: DateTime.t(),
  files: [FileStorageApi.File.t()],
  max_results: non_neg_integer(),
  name: String.t(),
  next_marker: String.t()
}

Link to this section Functions

Link to this function

create(container_name, opts \\ %{})

Will create container with binary as input for bucket name

Opts allows for setting cors_policy as map or true will only be applied to S3

Link to this function

list_files(container_name, options \\ [])

Specs

list_files(String.t(), options()) :: Enumerable.t()

List all files in the container.

Options are available for max_results: which can be adjusted.

It's build around stream so will automatically use the markers to get as many items as are in the bucket.

Link to this section Callbacks

Link to this callback

create(arg1, map)

Specs

create(String.t(), map()) :: {:ok, map()} | {:error, map()}
Link to this callback

list_files(arg1, options)

Specs

list_files(String.t(), options()) :: {:ok, [t()]} | {:error, map()}