Object/file storage abstraction for the Nova ecosystem.
nova_storage is not a dependency of Nova core and must never become one.
%% sys.config
{nova_storage, [
{stores, #{
avatars => #{
adapter => nova_storage_local,
root => "/var/data/avatars",
max_size => 5_000_000
},
uploads => #{
adapter => nova_storage_s3,
bucket => <<"my-uploads">>,
region => <<"eu-west-1">>,
access_key => "S3_ACCESS_KEY",
secret_key => "S3_SECRET_KEY"
}
}}
]}.
%% application code
{ok, Meta} = nova_storage:put(avatars, <<"alice.png">>, PngBytes,
#{content_type => <<"image/png">>}),
{ok, Body, _} = nova_storage:get(avatars, <<"alice.png">>),
{ok, Url} = nova_storage:sign_url(uploads, <<"some/key">>, get,
#{expires_in => 3600}).| Adapter | Status |
|---|---|
nova_storage_local |
v0.1 |
nova_storage_s3 |
v0.1 |
The S3 adapter works against AWS, Cloudflare R2, Scaleway Object, Minio, B2.
nova_storage is intentionally narrow: bytes in, bytes out, signed URLs,
listing. Audit logging, encryption-at-rest, and image transforms are
deliberately out of scope.
rebar3 compile
rebar3 dialyzer
rebar3 xrefrebar3 ct
rebar3 eunit
rebar3 mutateSee the guides directory.
Apache-2.0.