Routex.Extension.Plugs (Routex v1.2.2)
View SourceProvides integration for plugs defined by Routex extensions.
Detect extensions that implement supported plug callbacks. The valid plug
callbacks are then collected and attached to the options under the :plugs
key. Additionally, the module generates a Routex Plug hook that inlines the
plugs provided by these extensions so that they are invoked in a single plug
chain.
Summary
Functions
Detects and registers supported plug callbacks from other extensions.
Returns an updated keyword list with the valid plug callbacks accumulated
under the :plugs
key.
Generates a plug hook for Routex that inlines plugs provided by other extensions.
Functions
@spec configure(Routex.Types.opts(), Routex.Types.backend()) :: Routex.Types.opts()
Detects and registers supported plug callbacks from other extensions.
Returns an updated keyword list with the valid plug callbacks accumulated
under the :plugs
key.
Supported callbacks:
call/2
:Plug.Conn.call/2
@spec create_helpers( Routex.Types.routes(), Routex.Types.backend(), Routex.Types.env() ) :: Routex.Types.ast()
Generates a plug hook for Routex that inlines plugs provided by other extensions.
This helper function creates quoted expressions defining a plug function that encapsulates all the plug callbacks registered by Routex extension backends.