View Source Lightning.Extensions.RateLimiting behaviour (Lightning v2.10.4)

Rate limiting for Lightning API endpoints.

Summary

Types

@type message() :: Lightning.Extensions.Message.t()
@type request_error() :: :too_many_requests | :unknown

Callbacks

Link to this callback

limit_request(conn, context, opts)

View Source
@callback limit_request(
  conn :: Plug.Conn.t(),
  context :: Lightning.Extensions.RateLimiting.Context.t(),
  opts :: Keyword.t()
) :: :ok | {:error, request_error(), message()}