Pow v1.0.20 Pow.Extension.Base behaviour 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 Functions

Link to this function

has?(extension, module_list)

View Source
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
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.

Link to this section Callbacks

Link to this callback

ecto_schema?()

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

phoenix_controller_callbacks?()

View Source
phoenix_controller_callbacks?() :: boolean()
Link to this callback

phoenix_messages?()

View Source
phoenix_messages?() :: boolean()
Link to this callback

phoenix_router?()

View Source
phoenix_router?() :: boolean()
Link to this callback

phoenix_templates()

View Source
phoenix_templates() :: [{binary(), [binary()]}]
Link to this callback

use_ecto_schema?()

View Source
use_ecto_schema?() :: boolean()