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

Defines Supabase HTTP Clients callbacks

Summary

Types

The response handler for streaming responses. It receives the response status, headers, and body as input.

Types

on_response()

@type on_response() :: (on_response_input() ->
                    :ok | {:ok, term()} | {:error, Supabase.Error.t()})

The response handler for streaming responses. It receives the response status, headers, and body as input.

Note that here only the status and headers are consumed from the stream and so the body reamins unconsumed for custom operations, receiving each chunk of the body as it arrives.

It needs to return either :ok or {:ok, body} or {:error, Supabase.Error}.

on_response_input()

@type on_response_input() ::
  {Supabase.Fetcher.status(), Supabase.Fetcher.headers(),
   body :: Enumerable.t()}

Callbacks

request(t)

request_async(t)

stream(t)

stream(t, on_response)

upload(t, filepath)