Supabase.Fetcher.Adapter behaviour (supabase_potion v0.6.1)

Behaviour that defines the interface to implement different HTTP clients as backends for the Supabase.Fetcher request builder.

Summary

Types

request_opts()

@type request_opts() :: keyword()

response()

@type response() :: Supabase.Fetcher.response()

Callbacks

request(t, request_opts)

@callback request(Supabase.Fetcher.Request.t(), request_opts()) ::
  {:ok, response()} | {:error, term()}

request_async(t, request_opts)

(optional)
@callback request_async(Supabase.Fetcher.Request.t(), request_opts()) ::
  {:ok, response()} | {:error, term()}

stream(t, request_opts)

(optional)
@callback stream(Supabase.Fetcher.Request.t(), request_opts()) ::
  {:ok, response()} | {:error, term()}

stream(t, on_response, request_opts)

(optional)
@callback stream(Supabase.Fetcher.Request.t(), on_response, request_opts()) ::
  {:ok, response()} | {:error, term()}
when on_response: ({Supabase.Fetcher.status(), Supabase.Fetcher.headers(),
                    body :: Enumerable.t()} ->
                     {:ok, response()} | {:error, term()})

upload(t, filepath, request_opts)

@callback upload(Supabase.Fetcher.Request.t(), filepath :: Path.t(), request_opts()) ::
  {:ok, response()} | {:error, term()}

Functions

not_implemented_error(module, fun, arity)

@spec not_implemented_error(module(), atom(), integer()) :: Supabase.Error.t()