View Source Waffle.StorageBehavior behaviour (waffle v1.1.10)

Defines the behavior for file storage.

Callbacks

  • put/3: Saves a file and returns the file name or an error.
  • url/3: Generates a URL for accessing a file.
  • delete/3: Deletes a file and returns the result of the operation.

Summary

Callbacks

Link to this callback

delete(definition, version, file_and_scope)

View Source
@callback delete(
  definition :: atom(),
  version :: atom(),
  file_and_scope :: {Waffle.File.t(), any()}
) ::
  atom()
Link to this callback

put(definition, version, file_and_scope)

View Source
@callback put(
  definition :: atom(),
  version :: atom(),
  file_and_scope :: {Waffle.File.t(), any()}
) ::
  {:ok, file_name :: String.t()} | {:error, reason :: any()}
Link to this callback

url(definition, version, file_and_scope)

View Source
@callback url(
  definition :: atom(),
  version :: atom(),
  file_and_scope :: {Waffle.File.t(), any()}
) ::
  String.t()