storage v0.2.0 Storage.File View Source

Defines struct to save data about the file.

The struct contains:

  • filename - name of the saved file
  • path - path to the saved file
  • extension - extension of the saved file (without dot)
  • content_type - MIME type
  • metadata - information about the file

    • size - size in bytes
    • ctime - creation time
    • mtime - modification time

Link to this section Summary

Functions

Creates and returns a new Storage.File struct from path with given options

Link to this section Functions

Link to this function new(path, opts) View Source
new(String.t(), keyword()) :: %Storage.File{
  content_type: String.t(),
  extension: String.t(),
  filename: String.t(),
  metadata: %{size: integer(), ctime: tuple(), mtime: tuple()},
  path: String.t()
}

Creates and returns a new Storage.File struct from path with given options