exfile v0.3.4 Exfile.Backend.FileSystem

A local filesystem-backed backend.

FileSystem accepts the standard initialization options, plus one:

  • :ttl — configurable TTL (in seconds) for files stored in the backend. Files are checked and vacuumed on initialization or by calling vacuum/1 manually. Note that the mtime (file modification timestamp) is used to determine if a file should be deleted or not. This option only makes sense in an ephemeral cache configuration, never a persistent store.

Summary

Functions

Callback implementation for Exfile.Backend.delete/2

Callback implementation for Exfile.Backend.exists?/2

Callback implementation for Exfile.Backend.get/2

Callback implementation for Exfile.Backend.init/1

Callback implementation for Exfile.Backend.open/2

Callback implementation for Exfile.Backend.path/2

Callback implementation for Exfile.Backend.size/2

Scan & delete files in backend that have expired

Functions

clear!(backend)
delete(backend, id)

Callback implementation for Exfile.Backend.delete/2.

exists?(backend, id)

Callback implementation for Exfile.Backend.exists?/2.

get(backend, id)

Callback implementation for Exfile.Backend.get/2.

init(opts)

Callback implementation for Exfile.Backend.init/1.

open(backend, id)

Callback implementation for Exfile.Backend.open/2.

path(backend, id)

Callback implementation for Exfile.Backend.path/2.

size(backend, id)

Callback implementation for Exfile.Backend.size/2.

upload(backend, other_file)

Callback implementation for Exfile.Backend.upload/2.

vacuum(backend)

Specs

vacuum(Exfile.Backend.t) :: :ok | {:error, :file.posix}

Scan & delete files in backend that have expired

No-op when the :ttl option is “infinity” or nil (default).