View Source FileSystem.Backend behaviour (file_system v1.0.1)

A behaviour module for implementing different file system backend.

Summary

Functions

Get and validate backend module.

Callbacks

@callback bootstrap() :: :ok | {:error, atom()}
@callback known_events() :: [atom()]
@callback supported_systems() :: [{atom(), atom()}]

Functions

@spec backend(atom()) :: {:ok, atom()} | {:error, atom()}

Get and validate backend module.

Returns {:ok, backend_module} upon success and {:error, reason} upon failure.

When nil is given, will return default backend by OS.

When a custom module is given, make sure start_link/1, bootstrap/0 and supported_system/0 are defnied.