Supabase.Storage.ObjectHandler (supabase_storage v0.2.0)
A low-level API interface for managing objects within a Supabase bucket.
Responsibilities
- File Management: Create, move, copy, and get information about files in a bucket.
- Object Listing: List objects based on certain criteria, like a prefix.
- Object Removal: Delete specific objects or a list of objects.
- URL Management: Generate signed URLs for granting temporary access to objects.
- Content Access: Retrieve the content of an object or stream it.
Usage Warning
This module is meant for internal use or for developers requiring more control over object management in Supabase. In general, users should work with the higher-level Supabase.Storage API when possible, as it may offer better abstractions and safety mechanisms.
Directly interfacing with this module bypasses any additional logic the main API might provide. Use it with caution and ensure you understand its operations.
Summary
Types
Link to this type
bucket_name()
@type bucket_name() :: String.t()
Link to this type
file_path()
@type file_path() :: Path.t()
Link to this type
object_path()
@type object_path() :: Path.t()
Link to this type
opts()
@type opts() :: Supabase.Storage.ObjectOptions.t()
Link to this type
prefix()
@type prefix() :: String.t()
Link to this type
search_opts()
@type search_opts() :: Supabase.Storage.SearchOptions.t()
Link to this type
wildcard()
@type wildcard() :: String.t()
Functions
Link to this function
copy(base_url, api_key, token, bucket_id, path, to)
@spec copy( Supabase.Connection.base_url(), Supabase.Connection.api_key(), Supabase.Connection.access_token(), bucket_name(), object_path(), object_path() ) :: {:ok, :copied} | {:error, String.t()}
Link to this function
create_file(url, api_key, token, bucket, object_path, file_path, opts)
@spec create_file( Supabase.Connection.base_url(), Supabase.Connection.api_key(), Supabase.Connection.access_token(), bucket_name(), object_path(), file_path(), opts() ) :: {:ok, Supabase.Storage.Object.t()} | {:error, String.t()}
Link to this function
create_signed_url(base_url, api_key, token, bucket_name, path, expires_in)
@spec create_signed_url( Supabase.Connection.base_url(), Supabase.Connection.api_key(), Supabase.Connection.access_token(), bucket_name(), object_path(), integer() ) :: {:ok, String.t()} | {:error, String.t()}
Link to this function
get(base_url, api_key, token, bucket_name, wildcard)
@spec get( Supabase.Connection.base_url(), Supabase.Connection.api_key(), Supabase.Connection.access_token(), bucket_name(), object_path() ) :: {:ok, binary()} | {:error, String.t()}
Link to this function
get_info(base_url, api_key, token, bucket_name, wildcard)
@spec get_info( Supabase.Connection.base_url(), Supabase.Connection.api_key(), Supabase.Connection.access_token(), bucket_name(), wildcard() ) :: {:ok, Supabase.Storage.Object.t()} | {:error, String.t()}
Link to this function
get_lazy(base_url, api_key, token, bucket_name, wildcard)
@spec get_lazy( Supabase.Connection.base_url(), Supabase.Connection.api_key(), Supabase.Connection.access_token(), bucket_name(), wildcard() ) :: {:ok, Stream.t()} | {:error, atom()}
Link to this function
list(base_url, api_key, token, bucket_name, prefix, opts)
@spec list( Supabase.Connection.base_url(), Supabase.Connection.api_key(), Supabase.Connection.access_token(), bucket_name(), prefix(), search_opts() ) :: {:ok, [Supabase.Storage.Object.t()]} | {:error, String.t()}
Link to this function
move(base_url, api_key, token, bucket_id, path, to)
@spec move( Supabase.Connection.base_url(), Supabase.Connection.api_key(), Supabase.Connection.access_token(), bucket_name(), object_path(), object_path() ) :: {:ok, :moved} | {:error, String.t()}
Link to this function
remove(base_url, api_key, token, bucket_name, path)
@spec remove( Supabase.Connection.base_url(), Supabase.Connection.api_key(), Supabase.Connection.access_token(), bucket_name(), object_path() ) :: {:ok, :deleted} | {:error, String.t()}
Link to this function
remove_list(base_url, api_key, token, bucket_name, paths)
@spec remove_list( Supabase.Connection.base_url(), Supabase.Connection.api_key(), Supabase.Connection.access_token(), bucket_name(), [object_path()] ) :: {:ok, :deleted} | {:error, String.t()}