Yggdrasil v5.0.0 Yggdrasil.Settings View Source
This module defines the available settings for Yggdrasil.
Link to this section Summary
Functions
Module registry.
Module registry.
Yggdrasil publisher options. These options are for :poolboy
.
Yggdrasil publisher options. These options are for :poolboy
.
Pub-sub adapter to use for channels.
Pub-sub adapter to use for channels.
Pub-sub name.
Pub-sub name.
Pub-sub options.
Pub-sub options.
Puts the value
to Yggdrasil.Settings.module_registry/0
. Optionally, receives
the namespace
.
Puts the value
to Yggdrasil.Settings.publisher_options/0
. Optionally, receives
the namespace
.
Puts the value
to Yggdrasil.Settings.pubsub_adapter/0
. Optionally, receives
the namespace
.
Puts the value
to Yggdrasil.Settings.pubsub_name/0
. Optionally, receives
the namespace
.
Puts the value
to Yggdrasil.Settings.pubsub_options/0
. Optionally, receives
the namespace
.
Reloads the value for Yggdrasil.Settings.module_registry/0
. Optionally, receives
the namespace
for the variable.
Reloads the value for Yggdrasil.Settings.publisher_options/0
. Optionally, receives
the namespace
for the variable.
Reloads the value for Yggdrasil.Settings.pubsub_adapter/0
. Optionally, receives
the namespace
for the variable.
Reloads the value for Yggdrasil.Settings.pubsub_name/0
. Optionally, receives
the namespace
for the variable.
Reloads the value for Yggdrasil.Settings.pubsub_options/0
. Optionally, receives
the namespace
for the variable.
Link to this section Functions
module_registry(namespace \\ nil)
View Source
module_registry(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
module_registry(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
Module registry.
iex> Yggdrasil.Settings.module_registry!()
:"$yggdrasil_registry"
A call to Yggdrasil.Settings.module_registry()
:
- When the OS environment variable is not
nil
, then it'll return its casted value. - When the OS environment variable is
nil
, then it'll try to get the value from the configuration file. - When the configuration file does not contain the variable, then it'll return the default value if it's defined.
- When the default value is not defined and it's not required, it'll
return
nil
, otherwise it'll return an error.
A call to Yggdrasil.Settings.module_registry(namespace)
will try
to do the same as before, but with a namespace (atom()
). This is
useful for spliting different configurations values for the same variable
e.g. different environments.
The OS environment variables expected are:
- When no namespace is specified, then it'll be
$YGGDRASIL_MODULE_REGISTRY
. - When a namespace is specified e.g.
My.Custom.Namespace
, then it'll be$MY_CUSTOM_NAMESPACE_YGGDRASIL_MODULE_REGISTRY
.
The expected application configuration would be as follows:
- Without namespace:
config :yggdrasil,
module_registry: :atom() # Defaults to :"$yggdrasil_registry"
- With namespace e.g.
My.Custom.Namespace
:
config :yggdrasil, My.Custom.Namespace,
module_registry: :atom() # Defaults to :"$yggdrasil_registry"
module_registry!(namespace \\ nil)
View Source
module_registry!(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
module_registry!(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
Module registry.
iex> Yggdrasil.Settings.module_registry!()
:"$yggdrasil_registry"
Bang version of Yggdrasil.Settings.module_registry/0
(fails on error).
publisher_options(namespace \\ nil)
View Source
publisher_options(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
publisher_options(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
Yggdrasil publisher options. These options are for :poolboy
.
iex> Yggdrasil.Settings.publisher_options!()
[size: 1, max_overflow: 5]
A call to Yggdrasil.Settings.publisher_options()
:
- When the OS environment variable is not
nil
, then it'll return its casted value. - When the OS environment variable is
nil
, then it'll try to get the value from the configuration file. - When the configuration file does not contain the variable, then it'll return the default value if it's defined.
- When the default value is not defined and it's not required, it'll
return
nil
, otherwise it'll return an error.
A call to Yggdrasil.Settings.publisher_options(namespace)
will try
to do the same as before, but with a namespace (atom()
). This is
useful for spliting different configurations values for the same variable
e.g. different environments.
The OS environment variables expected are:
- When no namespace is specified, then it'll be
$YGGDRASIL_PUBLISHER_OPTIONS
. - When a namespace is specified e.g.
My.Custom.Namespace
, then it'll be$MY_CUSTOM_NAMESPACE_YGGDRASIL_PUBLISHER_OPTIONS
.
The expected application configuration would be as follows:
- Without namespace:
config :yggdrasil,
publisher_options: :binary() # Defaults to [size: 1, max_overflow: 5]
- With namespace e.g.
My.Custom.Namespace
:
config :yggdrasil, My.Custom.Namespace,
publisher_options: :binary() # Defaults to [size: 1, max_overflow: 5]
publisher_options!(namespace \\ nil)
View Source
publisher_options!(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
publisher_options!(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
Yggdrasil publisher options. These options are for :poolboy
.
iex> Yggdrasil.Settings.publisher_options!()
[size: 1, max_overflow: 5]
Bang version of Yggdrasil.Settings.publisher_options/0
(fails on error).
pubsub_adapter(namespace \\ nil)
View Source
pubsub_adapter(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
pubsub_adapter(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
Pub-sub adapter to use for channels.
iex> Yggdrasil.Settings.pubsub_adapter!()
Phoenix.PubSub.PG2
A call to Yggdrasil.Settings.pubsub_adapter()
:
- When the OS environment variable is not
nil
, then it'll return its casted value. - When the OS environment variable is
nil
, then it'll try to get the value from the configuration file. - When the configuration file does not contain the variable, then it'll return the default value if it's defined.
- When the default value is not defined and it's not required, it'll
return
nil
, otherwise it'll return an error.
A call to Yggdrasil.Settings.pubsub_adapter(namespace)
will try
to do the same as before, but with a namespace (atom()
). This is
useful for spliting different configurations values for the same variable
e.g. different environments.
The OS environment variables expected are:
- When no namespace is specified, then it'll be
$YGGDRASIL_PUBSUB_ADAPTER
. - When a namespace is specified e.g.
My.Custom.Namespace
, then it'll be$MY_CUSTOM_NAMESPACE_YGGDRASIL_PUBSUB_ADAPTER
.
The expected application configuration would be as follows:
- Without namespace:
config :yggdrasil,
pubsub_adapter: :atom() # Defaults to Phoenix.PubSub.PG2
- With namespace e.g.
My.Custom.Namespace
:
config :yggdrasil, My.Custom.Namespace,
pubsub_adapter: :atom() # Defaults to Phoenix.PubSub.PG2
pubsub_adapter!(namespace \\ nil)
View Source
pubsub_adapter!(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
pubsub_adapter!(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
Pub-sub adapter to use for channels.
iex> Yggdrasil.Settings.pubsub_adapter!()
Phoenix.PubSub.PG2
Bang version of Yggdrasil.Settings.pubsub_adapter/0
(fails on error).
pubsub_name(namespace \\ nil)
View Source
pubsub_name(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
pubsub_name(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
Pub-sub name.
iex> Yggdrasil.Settings.pubsub_name!()
Yggdrasil.PubSub
A call to Yggdrasil.Settings.pubsub_name()
:
- When the OS environment variable is not
nil
, then it'll return its casted value. - When the OS environment variable is
nil
, then it'll try to get the value from the configuration file. - When the configuration file does not contain the variable, then it'll return the default value if it's defined.
- When the default value is not defined and it's not required, it'll
return
nil
, otherwise it'll return an error.
A call to Yggdrasil.Settings.pubsub_name(namespace)
will try
to do the same as before, but with a namespace (atom()
). This is
useful for spliting different configurations values for the same variable
e.g. different environments.
The OS environment variables expected are:
- When no namespace is specified, then it'll be
$YGGDRASIL_PUBSUB_NAME
. - When a namespace is specified e.g.
My.Custom.Namespace
, then it'll be$MY_CUSTOM_NAMESPACE_YGGDRASIL_PUBSUB_NAME
.
The expected application configuration would be as follows:
- Without namespace:
config :yggdrasil,
pubsub_name: :atom() # Defaults to Yggdrasil.PubSub
- With namespace e.g.
My.Custom.Namespace
:
config :yggdrasil, My.Custom.Namespace,
pubsub_name: :atom() # Defaults to Yggdrasil.PubSub
pubsub_name!(namespace \\ nil)
View Source
pubsub_name!(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
pubsub_name!(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
Pub-sub name.
iex> Yggdrasil.Settings.pubsub_name!()
Yggdrasil.PubSub
Bang version of Yggdrasil.Settings.pubsub_name/0
(fails on error).
pubsub_options(namespace \\ nil)
View Source
pubsub_options(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
pubsub_options(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
Pub-sub options.
iex> Yggdrasil.Settings.pubsub_options!()
[pool_size: 1]
A call to Yggdrasil.Settings.pubsub_options()
:
- When the OS environment variable is not
nil
, then it'll return its casted value. - When the OS environment variable is
nil
, then it'll try to get the value from the configuration file. - When the configuration file does not contain the variable, then it'll return the default value if it's defined.
- When the default value is not defined and it's not required, it'll
return
nil
, otherwise it'll return an error.
A call to Yggdrasil.Settings.pubsub_options(namespace)
will try
to do the same as before, but with a namespace (atom()
). This is
useful for spliting different configurations values for the same variable
e.g. different environments.
The OS environment variables expected are:
- When no namespace is specified, then it'll be
$YGGDRASIL_PUBSUB_OPTIONS
. - When a namespace is specified e.g.
My.Custom.Namespace
, then it'll be$MY_CUSTOM_NAMESPACE_YGGDRASIL_PUBSUB_OPTIONS
.
The expected application configuration would be as follows:
- Without namespace:
config :yggdrasil,
pubsub_options: :binary() # Defaults to [pool_size: 1]
- With namespace e.g.
My.Custom.Namespace
:
config :yggdrasil, My.Custom.Namespace,
pubsub_options: :binary() # Defaults to [pool_size: 1]
pubsub_options!(namespace \\ nil)
View Source
pubsub_options!(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
pubsub_options!(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
Pub-sub options.
iex> Yggdrasil.Settings.pubsub_options!()
[pool_size: 1]
Bang version of Yggdrasil.Settings.pubsub_options/0
(fails on error).
put_module_registry(value, namespace \\ nil)
View Source
put_module_registry(term(), Skogsra.Env.namespace()) :: :ok | {:error, term()}
put_module_registry(term(), Skogsra.Env.namespace()) :: :ok | {:error, term()}
Puts the value
to Yggdrasil.Settings.module_registry/0
. Optionally, receives
the namespace
.
put_publisher_options(value, namespace \\ nil)
View Source
put_publisher_options(term(), Skogsra.Env.namespace()) :: :ok | {:error, term()}
put_publisher_options(term(), Skogsra.Env.namespace()) :: :ok | {:error, term()}
Puts the value
to Yggdrasil.Settings.publisher_options/0
. Optionally, receives
the namespace
.
put_pubsub_adapter(value, namespace \\ nil)
View Source
put_pubsub_adapter(term(), Skogsra.Env.namespace()) :: :ok | {:error, term()}
put_pubsub_adapter(term(), Skogsra.Env.namespace()) :: :ok | {:error, term()}
Puts the value
to Yggdrasil.Settings.pubsub_adapter/0
. Optionally, receives
the namespace
.
put_pubsub_name(value, namespace \\ nil)
View Source
put_pubsub_name(term(), Skogsra.Env.namespace()) :: :ok | {:error, term()}
put_pubsub_name(term(), Skogsra.Env.namespace()) :: :ok | {:error, term()}
Puts the value
to Yggdrasil.Settings.pubsub_name/0
. Optionally, receives
the namespace
.
put_pubsub_options(value, namespace \\ nil)
View Source
put_pubsub_options(term(), Skogsra.Env.namespace()) :: :ok | {:error, term()}
put_pubsub_options(term(), Skogsra.Env.namespace()) :: :ok | {:error, term()}
Puts the value
to Yggdrasil.Settings.pubsub_options/0
. Optionally, receives
the namespace
.
reload_module_registry(namespace \\ nil)
View Source
reload_module_registry(Skogsra.Env.namespace()) ::
{:ok, term()} | {:error, term()}
reload_module_registry(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
Reloads the value for Yggdrasil.Settings.module_registry/0
. Optionally, receives
the namespace
for the variable.
reload_publisher_options(namespace \\ nil)
View Source
reload_publisher_options(Skogsra.Env.namespace()) ::
{:ok, term()} | {:error, term()}
reload_publisher_options(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
Reloads the value for Yggdrasil.Settings.publisher_options/0
. Optionally, receives
the namespace
for the variable.
reload_pubsub_adapter(namespace \\ nil)
View Source
reload_pubsub_adapter(Skogsra.Env.namespace()) ::
{:ok, term()} | {:error, term()}
reload_pubsub_adapter(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
Reloads the value for Yggdrasil.Settings.pubsub_adapter/0
. Optionally, receives
the namespace
for the variable.
reload_pubsub_name(namespace \\ nil)
View Source
reload_pubsub_name(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
reload_pubsub_name(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
Reloads the value for Yggdrasil.Settings.pubsub_name/0
. Optionally, receives
the namespace
for the variable.
reload_pubsub_options(namespace \\ nil)
View Source
reload_pubsub_options(Skogsra.Env.namespace()) ::
{:ok, term()} | {:error, term()}
reload_pubsub_options(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
Reloads the value for Yggdrasil.Settings.pubsub_options/0
. Optionally, receives
the namespace
for the variable.