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

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

Link to this section Summary

Functions

Checks whether an extension has a certain module.

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

Link to this section Callbacks

Specs

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

phoenix_controller_callbacks?()

View Source

Specs

phoenix_controller_callbacks?() :: boolean()

Specs

phoenix_messages?() :: boolean()

Specs

phoenix_router?() :: boolean()

Specs

phoenix_templates() :: [{binary(), [binary()]}]

Specs

use_ecto_schema?() :: boolean()

Link to this section Functions

Link to this function

has?(extension, module_list)

View Source

Specs

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

Specs

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.