Routex.Extension.Plugs (Routex v1.2.2)

View Source

Provides 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

configure(opts, backend)

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

create_helpers(routes, backend, env)

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.