View Source Electric.Shapes.Api (electric v1.0.0-beta.19)

Summary

Types

@type options() :: [
  inspector: {module(), [term()]},
  pg_id: binary(),
  registry: atom(),
  shape_cache: {module(), [term()]},
  stack_events_registry: atom(),
  stack_id: binary(),
  storage: {module(), [term()]},
  persistent_kv: term(),
  allow_shape_deletion: boolean(),
  long_poll_timeout: integer(),
  max_age: integer(),
  stack_ready_timeout: integer(),
  stale_age: integer(),
  encoder: atom()
]
@type t() :: %Electric.Shapes.Api{
  allow_shape_deletion: term(),
  configured: term(),
  encoder: term(),
  inspector: term(),
  long_poll_timeout: term(),
  max_age: term(),
  persistent_kv: term(),
  pg_id: term(),
  registry: term(),
  shape_cache: term(),
  stack_events_registry: term(),
  stack_id: term(),
  stack_ready_timeout: term(),
  stale_age: term(),
  storage: term()
}

Functions

Link to this function

encode_message(api, message)

View Source
@spec encode_message(t() | Electric.Shapes.Api.Request.t(), term()) :: Enum.t()
Link to this function

serve_shape_log(request)

View Source

Return shape log data.

@spec stack_id(t() | Electric.Shapes.Api.Request.t()) :: String.t()
@spec validate(t(), %{required(atom() | binary()) => term()}) ::
  {:ok, Electric.Shapes.Api.Request.t()}
  | {:error, Electric.Shapes.Api.Response.t()}

Validate the parameters for the request.

Options:

  • seek: boolean() - (default: true) once validated should we load the shape's latest offset information.

  • load: boolean() - (default: true) validate and optionallly create a shape based on the handle and shape parameters.

Link to this function

validate_for_delete(api, params)

View Source
@spec validate_for_delete(t(), %{required(atom() | binary()) => term()}) ::
  {:ok, Electric.Shapes.Api.Request.t()}
  | {:error, Electric.Shapes.Api.Response.t()}