Yggdrasil v4.1.5 Yggdrasil.Settings View Source

This module defines the available settings for Yggdrasil.

Use h Yggdrasil.Settings.<name of the environment variable> to get more information about every declaration in this file.

Link to this section Summary

Functions

Yggdrasil publisher options. This options are for :poolboy. Defaults to [size: 5, max_overflow: 10]

Yggdrasil publisher options. This options are for :poolboy. Defaults to [size: 5, max_overflow: 10]

Pub-sub adapter to use for channels. Default value is Phoenix.PubSub.PG2

Pub-sub adapter to use for channels. Default value is Phoenix.PubSub.PG2

Pub-sub name. By default is Yggdrasil.PubSub

Pub-sub name. By default is Yggdrasil.PubSub

Pub-sub options. By default are [pool_size: 1]

Pub-sub options. By default are [pool_size: 1]

Link to this section Functions

Link to this function yggdrasil_module_registry(namespace \\ nil, type \\ :run) View Source
yggdrasil_module_registry(
  namespace :: atom(),
  type :: :run | :reload | :system | :config
) :: {:ok, term()} | {:error, term()}

Module registry table name.

A call to Yggdrasil.Settings.yggdrasil_module_registry() will:

  1. If the OS environment variable is not nil, will return its casted value.
  2. If the OS environment variable is nil, then it will try to get the value in the configuration file.
  3. If the configuration file does not contain the value, will return the default value if it’s defined.
  4. If the default value is not defined and is not required, it will return nil, otherwise it will error.

A call to Yggdrasil.Settings.yggdrasil_module_registry(namespace) will try to do the same as before, but using a namespace (atom()). This is useful for separating the different configurations values for the same variable.

The OS environment variable expected is $YGGDRASIL_MODULE_REGISTRY. If there is a namespace, for example Namespace, the OS environment variable would be $NAMESPACE_YGGDRASIL_MODULE_REGISTRY.

The expected application configuration is as follows:

config :yggdrasil,
  module_registry: atom() # Defaults to :yggdrasil_registry

and with a namespace, for example Namespace, the expected application configuration would be:

config :yggdrasil, Namespace,
  module_registry: atom() # Defaults to :yggdrasil_registry

For testing purposes, the value can be reloaded at runtime with the function Yggdrasil.Settings.yggdrasil_module_registry(namespace, :reload) where namespace can be nil or an atom().

Link to this function yggdrasil_module_registry!(namespace \\ nil) View Source
yggdrasil_module_registry!(namespace :: atom()) ::
  {:ok, term()} | {:error, term()}

Module registry table name.

Same as Yggdrasil.Settings.yggdrasil_module_registry/0 but fails on error.

It can receive also a namespace when needed.

Link to this function yggdrasil_process_registry(namespace \\ nil, type \\ :run) View Source
yggdrasil_process_registry(
  namespace :: atom(),
  type :: :run | :reload | :system | :config
) :: {:ok, term()} | {:error, term()}

Process registry.

A call to Yggdrasil.Settings.yggdrasil_process_registry() will:

  1. If the OS environment variable is not nil, will return its casted value.
  2. If the OS environment variable is nil, then it will try to get the value in the configuration file.
  3. If the configuration file does not contain the value, will return the default value if it’s defined.
  4. If the default value is not defined and is not required, it will return nil, otherwise it will error.

A call to Yggdrasil.Settings.yggdrasil_process_registry(namespace) will try to do the same as before, but using a namespace (atom()). This is useful for separating the different configurations values for the same variable.

The OS environment variable expected is $YGGDRASIL_PROCESS_REGISTRY. If there is a namespace, for example Namespace, the OS environment variable would be $NAMESPACE_YGGDRASIL_PROCESS_REGISTRY.

The expected application configuration is as follows:

config :yggdrasil,
  process_registry: atom() # Defaults to ExReg

and with a namespace, for example Namespace, the expected application configuration would be:

config :yggdrasil, Namespace,
  process_registry: atom() # Defaults to ExReg

For testing purposes, the value can be reloaded at runtime with the function Yggdrasil.Settings.yggdrasil_process_registry(namespace, :reload) where namespace can be nil or an atom().

Link to this function yggdrasil_process_registry!(namespace \\ nil) View Source
yggdrasil_process_registry!(namespace :: atom()) ::
  {:ok, term()} | {:error, term()}

Process registry.

Same as Yggdrasil.Settings.yggdrasil_process_registry/0 but fails on error.

It can receive also a namespace when needed.

Link to this function yggdrasil_publisher_options(namespace \\ nil, type \\ :run) View Source
yggdrasil_publisher_options(
  namespace :: atom(),
  type :: :run | :reload | :system | :config
) :: {:ok, term()} | {:error, term()}

Yggdrasil publisher options. This options are for :poolboy. Defaults to [size: 5, max_overflow: 10].

A call to Yggdrasil.Settings.yggdrasil_publisher_options() will:

  1. If the OS environment variable is not nil, will return its casted value.
  2. If the OS environment variable is nil, then it will try to get the value in the configuration file.
  3. If the configuration file does not contain the value, will return the default value if it’s defined.
  4. If the default value is not defined and is not required, it will return nil, otherwise it will error.

A call to Yggdrasil.Settings.yggdrasil_publisher_options(namespace) will try to do the same as before, but using a namespace (atom()). This is useful for separating the different configurations values for the same variable.

The OS environment variable expected is $YGGDRASIL_PUBLISHER_OPTIONS. If there is a namespace, for example Namespace, the OS environment variable would be $NAMESPACE_YGGDRASIL_PUBLISHER_OPTIONS.

The expected application configuration is as follows:

config :yggdrasil,
  publisher_options: () # Defaults to [size: 5, max_overflow: 10]

and with a namespace, for example Namespace, the expected application configuration would be:

config :yggdrasil, Namespace,
  publisher_options: () # Defaults to [size: 5, max_overflow: 10]

For testing purposes, the value can be reloaded at runtime with the function Yggdrasil.Settings.yggdrasil_publisher_options(namespace, :reload) where namespace can be nil or an atom().

Link to this function yggdrasil_publisher_options!(namespace \\ nil) View Source
yggdrasil_publisher_options!(namespace :: atom()) ::
  {:ok, term()} | {:error, term()}

Yggdrasil publisher options. This options are for :poolboy. Defaults to [size: 5, max_overflow: 10].

Same as Yggdrasil.Settings.yggdrasil_publisher_options/0 but fails on error.

It can receive also a namespace when needed.

Link to this function yggdrasil_pubsub_adapter(namespace \\ nil, type \\ :run) View Source
yggdrasil_pubsub_adapter(
  namespace :: atom(),
  type :: :run | :reload | :system | :config
) :: {:ok, term()} | {:error, term()}

Pub-sub adapter to use for channels. Default value is Phoenix.PubSub.PG2.

A call to Yggdrasil.Settings.yggdrasil_pubsub_adapter() will:

  1. If the OS environment variable is not nil, will return its casted value.
  2. If the OS environment variable is nil, then it will try to get the value in the configuration file.
  3. If the configuration file does not contain the value, will return the default value if it’s defined.
  4. If the default value is not defined and is not required, it will return nil, otherwise it will error.

A call to Yggdrasil.Settings.yggdrasil_pubsub_adapter(namespace) will try to do the same as before, but using a namespace (atom()). This is useful for separating the different configurations values for the same variable.

The OS environment variable expected is $YGGDRASIL_PUBSUB_ADAPTER. If there is a namespace, for example Namespace, the OS environment variable would be $NAMESPACE_YGGDRASIL_PUBSUB_ADAPTER.

The expected application configuration is as follows:

config :yggdrasil,
  pubsub_adapter: atom() # Defaults to Phoenix.PubSub.PG2

and with a namespace, for example Namespace, the expected application configuration would be:

config :yggdrasil, Namespace,
  pubsub_adapter: atom() # Defaults to Phoenix.PubSub.PG2

For testing purposes, the value can be reloaded at runtime with the function Yggdrasil.Settings.yggdrasil_pubsub_adapter(namespace, :reload) where namespace can be nil or an atom().

Link to this function yggdrasil_pubsub_adapter!(namespace \\ nil) View Source
yggdrasil_pubsub_adapter!(namespace :: atom()) ::
  {:ok, term()} | {:error, term()}

Pub-sub adapter to use for channels. Default value is Phoenix.PubSub.PG2.

Same as Yggdrasil.Settings.yggdrasil_pubsub_adapter/0 but fails on error.

It can receive also a namespace when needed.

Link to this function yggdrasil_pubsub_name(namespace \\ nil, type \\ :run) View Source
yggdrasil_pubsub_name(
  namespace :: atom(),
  type :: :run | :reload | :system | :config
) :: {:ok, term()} | {:error, term()}

Pub-sub name. By default is Yggdrasil.PubSub.

A call to Yggdrasil.Settings.yggdrasil_pubsub_name() will:

  1. If the OS environment variable is not nil, will return its casted value.
  2. If the OS environment variable is nil, then it will try to get the value in the configuration file.
  3. If the configuration file does not contain the value, will return the default value if it’s defined.
  4. If the default value is not defined and is not required, it will return nil, otherwise it will error.

A call to Yggdrasil.Settings.yggdrasil_pubsub_name(namespace) will try to do the same as before, but using a namespace (atom()). This is useful for separating the different configurations values for the same variable.

The OS environment variable expected is $YGGDRASIL_PUBSUB_NAME. If there is a namespace, for example Namespace, the OS environment variable would be $NAMESPACE_YGGDRASIL_PUBSUB_NAME.

The expected application configuration is as follows:

config :yggdrasil,
  pubsub_name: atom() # Defaults to Yggdrasil.PubSub

and with a namespace, for example Namespace, the expected application configuration would be:

config :yggdrasil, Namespace,
  pubsub_name: atom() # Defaults to Yggdrasil.PubSub

For testing purposes, the value can be reloaded at runtime with the function Yggdrasil.Settings.yggdrasil_pubsub_name(namespace, :reload) where namespace can be nil or an atom().

Link to this function yggdrasil_pubsub_name!(namespace \\ nil) View Source
yggdrasil_pubsub_name!(namespace :: atom()) :: {:ok, term()} | {:error, term()}

Pub-sub name. By default is Yggdrasil.PubSub.

Same as Yggdrasil.Settings.yggdrasil_pubsub_name/0 but fails on error.

It can receive also a namespace when needed.

Link to this function yggdrasil_pubsub_options(namespace \\ nil, type \\ :run) View Source
yggdrasil_pubsub_options(
  namespace :: atom(),
  type :: :run | :reload | :system | :config
) :: {:ok, term()} | {:error, term()}

Pub-sub options. By default are [pool_size: 1].

A call to Yggdrasil.Settings.yggdrasil_pubsub_options() will:

  1. If the OS environment variable is not nil, will return its casted value.
  2. If the OS environment variable is nil, then it will try to get the value in the configuration file.
  3. If the configuration file does not contain the value, will return the default value if it’s defined.
  4. If the default value is not defined and is not required, it will return nil, otherwise it will error.

A call to Yggdrasil.Settings.yggdrasil_pubsub_options(namespace) will try to do the same as before, but using a namespace (atom()). This is useful for separating the different configurations values for the same variable.

The OS environment variable expected is $YGGDRASIL_PUBSUB_OPTIONS. If there is a namespace, for example Namespace, the OS environment variable would be $NAMESPACE_YGGDRASIL_PUBSUB_OPTIONS.

The expected application configuration is as follows:

config :yggdrasil,
  pubsub_options: () # Defaults to [pool_size: 1]

and with a namespace, for example Namespace, the expected application configuration would be:

config :yggdrasil, Namespace,
  pubsub_options: () # Defaults to [pool_size: 1]

For testing purposes, the value can be reloaded at runtime with the function Yggdrasil.Settings.yggdrasil_pubsub_options(namespace, :reload) where namespace can be nil or an atom().

Link to this function yggdrasil_pubsub_options!(namespace \\ nil) View Source
yggdrasil_pubsub_options!(namespace :: atom()) ::
  {:ok, term()} | {:error, term()}

Pub-sub options. By default are [pool_size: 1].

Same as Yggdrasil.Settings.yggdrasil_pubsub_options/0 but fails on error.

It can receive also a namespace when needed.