View Source Pow.Extension.Base behaviour (Pow v1.0.36)

Used to set up extensions to enable parts of extension for auto-discovery.

This exists to prevent unnecessary Code.ensure_compiled/1 calls, and will let the extension define what modules it has.

Usage

defmodule MyCustomExtension do
  use Pow.Extension.Base

  @impl true
  def ecto_schema?(), do: true
end

Summary

Functions

Checks whether an extension has a certain module.

Checks whether an extension has a certain module that has a __using__/1 macro.

Callbacks

@callback ecto_schema?() :: boolean()
Link to this callback

phoenix_controller_callbacks?()

View Source
@callback phoenix_controller_callbacks?() :: boolean()
@callback phoenix_messages?() :: boolean()
@callback phoenix_router?() :: boolean()
@callback phoenix_templates() :: [{binary(), [binary()]}]
@callback use_ecto_schema?() :: boolean()

Functions

Link to this function

has?(extension, module_list)

View Source
@spec has?(atom(), [any()]) :: boolean()

Checks whether an extension has a certain module.

If a base extension module doesn't exist, or is configured improperly, Code.ensure_compiled/1 will be used instead to see whether the module exists for the extension.

Link to this function

use?(extension, module_list)

View Source
@spec use?(atom(), [any()]) :: boolean()

Checks whether an extension has a certain module that has a __using__/1 macro.

This calls has?/2 first, If a base extension module doesn't exist, or is configured improperly, Kernel.macro_exported?/3 will be used instead to check if the module has a __using__/1 macro.