View Source Electric.Client.Fetch.Request (Electric Client v0.2.0)

Summary

Functions

Returns the URL for the Request.

Types

@type attr() ::
  {:headers, headers()}
  | {:params, params()}
  | {:shape, Electric.Client.ShapeDefinition.t()}
  | {:next_cursor, Electric.Client.cursor()}
  | {:live, boolean()}
  | {:update_mode, Electric.Client.update_mode()}
  | {:shape_handle, Electric.Client.shape_handle() | nil}
  | {:offset, Electric.Client.Offset.t()}
  | {:method, :get | :head | :delete}
@type attrs() ::
  [attr()]
  | %{
      method: :get | :head | :delete,
      offset: Electric.Client.Offset.t(),
      shape_handle: Electric.Client.shape_handle() | nil,
      update_mode: Electric.Client.update_mode(),
      live: boolean(),
      next_cursor: Electric.Client.cursor(),
      shape: Electric.Client.ShapeDefinition.t(),
      params: params(),
      headers: headers()
    }
@type authenticated() :: %Electric.Client.Fetch.Request{
  authenticated: true,
  base_url: URI.t(),
  headers: headers(),
  live: boolean(),
  method: :get | :head | :delete,
  next_cursor: Electric.Client.cursor(),
  offset: Electric.Client.Offset.t(),
  params: params(),
  shape: Electric.Client.ShapeDefinition.t(),
  shape_handle: Electric.Client.shape_handle() | nil,
  update_mode: Electric.Client.update_mode()
}
@type headers() :: %{required(String.t()) => [String.t()] | String.t()}
@type params() :: %{required(String.t()) => String.t()}
@type t() :: unauthenticated() | authenticated()
@type unauthenticated() :: %Electric.Client.Fetch.Request{
  authenticated: false,
  base_url: URI.t(),
  headers: headers(),
  live: boolean(),
  method: :get | :head | :delete,
  next_cursor: Electric.Client.cursor(),
  offset: Electric.Client.Offset.t(),
  params: params(),
  shape: Electric.Client.ShapeDefinition.t(),
  shape_handle: Electric.Client.shape_handle() | nil,
  update_mode: Electric.Client.update_mode()
}

Functions

Link to this function

url(request, opts \\ [])

View Source

Returns the URL for the Request.