Yggdrasil for PostgreSQL v5.0.2 Yggdrasil.Settings.Postgres View Source
This module defines the available settings for PostgreSQL in Yggdrasil.
Link to this section Summary
Functions
Postgres database. Defaults to "postgres".
Postgres database. Defaults to "postgres".
Postgres hostname. Defaults to "localhost".
Postgres hostname. Defaults to "localhost".
Postgres max retries for the backoff algorithm. Defaults to 3.
Postgres max retries for the backoff algorithm. Defaults to 3.
Postgres password. Defaults to "postgres".
Postgres password. Defaults to "postgres".
Postgres port. Defaults to 5432.
Postgres port. Defaults to 5432.
PostgreSQL amount of publisher connections.
PostgreSQL amount of publisher connections.
Puts the value to Yggdrasil.Settings.Postgres.database/0. Optionally, receives
the namespace.
Puts the value to Yggdrasil.Settings.Postgres.hostname/0. Optionally, receives
the namespace.
Puts the value to Yggdrasil.Settings.Postgres.max_retries/0. Optionally, receives
the namespace.
Puts the value to Yggdrasil.Settings.Postgres.password/0. Optionally, receives
the namespace.
Puts the value to Yggdrasil.Settings.Postgres.port/0. Optionally, receives
the namespace.
Puts the value to Yggdrasil.Settings.Postgres.publisher_connections/0. Optionally, receives
the namespace.
Puts the value to Yggdrasil.Settings.Postgres.slot_size/0. Optionally, receives
the namespace.
Puts the value to Yggdrasil.Settings.Postgres.subscriber_connections/0. Optionally, receives
the namespace.
Puts the value to Yggdrasil.Settings.Postgres.username/0. Optionally, receives
the namespace.
Reloads the value for Yggdrasil.Settings.Postgres.database/0. Optionally, receives
the namespace for the variable.
Reloads the value for Yggdrasil.Settings.Postgres.hostname/0. Optionally, receives
the namespace for the variable.
Reloads the value for Yggdrasil.Settings.Postgres.max_retries/0. Optionally, receives
the namespace for the variable.
Reloads the value for Yggdrasil.Settings.Postgres.password/0. Optionally, receives
the namespace for the variable.
Reloads the value for Yggdrasil.Settings.Postgres.port/0. Optionally, receives
the namespace for the variable.
Reloads the value for Yggdrasil.Settings.Postgres.publisher_connections/0. Optionally, receives
the namespace for the variable.
Reloads the value for Yggdrasil.Settings.Postgres.slot_size/0. Optionally, receives
the namespace for the variable.
Reloads the value for Yggdrasil.Settings.Postgres.subscriber_connections/0. Optionally, receives
the namespace for the variable.
Reloads the value for Yggdrasil.Settings.Postgres.username/0. Optionally, receives
the namespace for the variable.
Postgres slot size for the backoff algorithm. Defaults to 100.
Postgres slot size for the backoff algorithm. Defaults to 100.
PostgreSQL amount of subscriber connections.
PostgreSQL amount of subscriber connections.
Creates a template for OS environment variables given a filename.
Additionally, it can receive a list of options
Postgres username. Defaults to "postgres".
Postgres username. Defaults to "postgres".
Link to this section Functions
database(namespace \\ nil)
View Sourcedatabase(Skogsra.Env.namespace()) :: {:ok, binary()} | {:error, binary()}
Postgres database. Defaults to "postgres".
iex> Yggdrasil.Settings.Postgres.database()
{:ok, "postgres"}
Calling Yggdrasil.Settings.Postgres.database() will ensure the following:
- Binding order: [:system, :config]
- OS environment variable: "YGGDRASIL_POSTGRES_DATABASE"
- Type: :binary
- Default: "postgres"
- Required: false
- Cached: true
database!(namespace \\ nil)
View Sourcedatabase!(Skogsra.Env.namespace()) :: binary() | no_return()
Postgres database. Defaults to "postgres".
iex> Yggdrasil.Settings.Postgres.database()
{:ok, "postgres"}
Bang version of Yggdrasil.Settings.Postgres.database/0 (fails on error). Optionally,
receives the namespace for the variable.
hostname(namespace \\ nil)
View Sourcehostname(Skogsra.Env.namespace()) :: {:ok, binary()} | {:error, binary()}
Postgres hostname. Defaults to "localhost".
Calling Yggdrasil.Settings.Postgres.hostname() will ensure the following:
- Binding order: [:system, :config]
- OS environment variable: "YGGDRASIL_POSTGRES_HOSTNAME"
- Type: :binary
- Default: "localhost"
- Required: false
- Cached: true
hostname!(namespace \\ nil)
View Sourcehostname!(Skogsra.Env.namespace()) :: binary() | no_return()
Postgres hostname. Defaults to "localhost".
Bang version of Yggdrasil.Settings.Postgres.hostname/0 (fails on error). Optionally,
receives the namespace for the variable.
max_retries(namespace \\ nil)
View Sourcemax_retries(Skogsra.Env.namespace()) :: {:ok, integer()} | {:error, binary()}
Postgres max retries for the backoff algorithm. Defaults to 3.
The backoff algorithm is exponential:
backoff_time = pow(2, retries) * random(1, slot) * 1_000 ms
when retries <= MAX_RETRIES and slot is given by the configuration
variable Elixir.Yggdrasil.Settings.Postgres.slot_size/0 (defaults to 10 secs).
iex> Yggdrasil.Settings.Postgres.max_retries()
{:ok, 3}
Calling Yggdrasil.Settings.Postgres.max_retries() will ensure the following:
- Binding order: [:system, :config]
- OS environment variable: "YGGDRASIL_POSTGRES_MAX_RETRIES"
- Type: :integer
- Default: 3
- Required: false
- Cached: true
max_retries!(namespace \\ nil)
View Sourcemax_retries!(Skogsra.Env.namespace()) :: integer() | no_return()
Postgres max retries for the backoff algorithm. Defaults to 3.
The backoff algorithm is exponential:
backoff_time = pow(2, retries) * random(1, slot) * 1_000 ms
when retries <= MAX_RETRIES and slot is given by the configuration
variable Elixir.Yggdrasil.Settings.Postgres.slot_size/0 (defaults to 10 secs).
iex> Yggdrasil.Settings.Postgres.max_retries()
{:ok, 3}
Bang version of Yggdrasil.Settings.Postgres.max_retries/0 (fails on error). Optionally,
receives the namespace for the variable.
password(namespace \\ nil)
View Sourcepassword(Skogsra.Env.namespace()) :: {:ok, binary()} | {:error, binary()}
Postgres password. Defaults to "postgres".
iex> Yggdrasil.Settings.Postgres.password()
{:ok, "postgres"}
Calling Yggdrasil.Settings.Postgres.password() will ensure the following:
- Binding order: [:system, :config]
- OS environment variable: "YGGDRASIL_POSTGRES_PASSWORD"
- Type: :binary
- Default: "postgres"
- Required: false
- Cached: true
password!(namespace \\ nil)
View Sourcepassword!(Skogsra.Env.namespace()) :: binary() | no_return()
Postgres password. Defaults to "postgres".
iex> Yggdrasil.Settings.Postgres.password()
{:ok, "postgres"}
Bang version of Yggdrasil.Settings.Postgres.password/0 (fails on error). Optionally,
receives the namespace for the variable.
port(namespace \\ nil)
View Sourceport(Skogsra.Env.namespace()) :: {:ok, integer()} | {:error, binary()}
Postgres port. Defaults to 5432.
iex> Yggdrasil.Settings.Postgres.port()
{:ok, 5432}
Calling Yggdrasil.Settings.Postgres.port() will ensure the following:
- Binding order: [:system, :config]
- OS environment variable: "YGGDRASIL_POSTGRES_PORT"
- Type: :integer
- Default: 5432
- Required: false
- Cached: true
port!(namespace \\ nil)
View Sourceport!(Skogsra.Env.namespace()) :: integer() | no_return()
Postgres port. Defaults to 5432.
iex> Yggdrasil.Settings.Postgres.port()
{:ok, 5432}
Bang version of Yggdrasil.Settings.Postgres.port/0 (fails on error). Optionally,
receives the namespace for the variable.
publisher_connections(namespace \\ nil)
View Sourcepublisher_connections(Skogsra.Env.namespace()) :: {:ok, integer()} | {:error, binary()}
PostgreSQL amount of publisher connections.
iex> Yggdrasil.Settings.Postgres.publisher_connections()
{:ok, 1}
Calling Yggdrasil.Settings.Postgres.publisher_connections() will ensure the following:
- Binding order: [:system, :config]
- OS environment variable: "YGGDRASIL_POSTGRES_PUBLISHER_CONNECTIONS"
- Type: :integer
- Default: 1
- Required: false
- Cached: true
publisher_connections!(namespace \\ nil)
View Sourcepublisher_connections!(Skogsra.Env.namespace()) :: integer() | no_return()
PostgreSQL amount of publisher connections.
iex> Yggdrasil.Settings.Postgres.publisher_connections()
{:ok, 1}
Bang version of Yggdrasil.Settings.Postgres.publisher_connections/0 (fails on error). Optionally,
receives the namespace for the variable.
put_database(value, namespace \\ nil)
View Sourceput_database(binary(), Skogsra.Env.namespace()) :: :ok | {:error, binary()}
Puts the value to Yggdrasil.Settings.Postgres.database/0. Optionally, receives
the namespace.
put_hostname(value, namespace \\ nil)
View Sourceput_hostname(binary(), Skogsra.Env.namespace()) :: :ok | {:error, binary()}
Puts the value to Yggdrasil.Settings.Postgres.hostname/0. Optionally, receives
the namespace.
put_max_retries(value, namespace \\ nil)
View Sourceput_max_retries(integer(), Skogsra.Env.namespace()) :: :ok | {:error, binary()}
Puts the value to Yggdrasil.Settings.Postgres.max_retries/0. Optionally, receives
the namespace.
put_password(value, namespace \\ nil)
View Sourceput_password(binary(), Skogsra.Env.namespace()) :: :ok | {:error, binary()}
Puts the value to Yggdrasil.Settings.Postgres.password/0. Optionally, receives
the namespace.
put_port(value, namespace \\ nil)
View Sourceput_port(integer(), Skogsra.Env.namespace()) :: :ok | {:error, binary()}
Puts the value to Yggdrasil.Settings.Postgres.port/0. Optionally, receives
the namespace.
put_publisher_connections(value, namespace \\ nil)
View Sourceput_publisher_connections(integer(), Skogsra.Env.namespace()) :: :ok | {:error, binary()}
Puts the value to Yggdrasil.Settings.Postgres.publisher_connections/0. Optionally, receives
the namespace.
put_slot_size(value, namespace \\ nil)
View Sourceput_slot_size(integer(), Skogsra.Env.namespace()) :: :ok | {:error, binary()}
Puts the value to Yggdrasil.Settings.Postgres.slot_size/0. Optionally, receives
the namespace.
put_subscriber_connections(value, namespace \\ nil)
View Sourceput_subscriber_connections(integer(), Skogsra.Env.namespace()) :: :ok | {:error, binary()}
Puts the value to Yggdrasil.Settings.Postgres.subscriber_connections/0. Optionally, receives
the namespace.
put_username(value, namespace \\ nil)
View Sourceput_username(binary(), Skogsra.Env.namespace()) :: :ok | {:error, binary()}
Puts the value to Yggdrasil.Settings.Postgres.username/0. Optionally, receives
the namespace.
reload_database(namespace \\ nil)
View Sourcereload_database(Skogsra.Env.namespace()) :: {:ok, binary()} | {:error, binary()}
Reloads the value for Yggdrasil.Settings.Postgres.database/0. Optionally, receives
the namespace for the variable.
reload_hostname(namespace \\ nil)
View Sourcereload_hostname(Skogsra.Env.namespace()) :: {:ok, binary()} | {:error, binary()}
Reloads the value for Yggdrasil.Settings.Postgres.hostname/0. Optionally, receives
the namespace for the variable.
reload_max_retries(namespace \\ nil)
View Sourcereload_max_retries(Skogsra.Env.namespace()) :: {:ok, integer()} | {:error, binary()}
Reloads the value for Yggdrasil.Settings.Postgres.max_retries/0. Optionally, receives
the namespace for the variable.
reload_password(namespace \\ nil)
View Sourcereload_password(Skogsra.Env.namespace()) :: {:ok, binary()} | {:error, binary()}
Reloads the value for Yggdrasil.Settings.Postgres.password/0. Optionally, receives
the namespace for the variable.
reload_port(namespace \\ nil)
View Sourcereload_port(Skogsra.Env.namespace()) :: {:ok, integer()} | {:error, binary()}
Reloads the value for Yggdrasil.Settings.Postgres.port/0. Optionally, receives
the namespace for the variable.
reload_publisher_connections(namespace \\ nil)
View Sourcereload_publisher_connections(Skogsra.Env.namespace()) :: {:ok, integer()} | {:error, binary()}
Reloads the value for Yggdrasil.Settings.Postgres.publisher_connections/0. Optionally, receives
the namespace for the variable.
reload_slot_size(namespace \\ nil)
View Sourcereload_slot_size(Skogsra.Env.namespace()) :: {:ok, integer()} | {:error, binary()}
Reloads the value for Yggdrasil.Settings.Postgres.slot_size/0. Optionally, receives
the namespace for the variable.
reload_subscriber_connections(namespace \\ nil)
View Sourcereload_subscriber_connections(Skogsra.Env.namespace()) :: {:ok, integer()} | {:error, binary()}
Reloads the value for Yggdrasil.Settings.Postgres.subscriber_connections/0. Optionally, receives
the namespace for the variable.
reload_username(namespace \\ nil)
View Sourcereload_username(Skogsra.Env.namespace()) :: {:ok, binary()} | {:error, binary()}
Reloads the value for Yggdrasil.Settings.Postgres.username/0. Optionally, receives
the namespace for the variable.
slot_size(namespace \\ nil)
View Sourceslot_size(Skogsra.Env.namespace()) :: {:ok, integer()} | {:error, binary()}
Postgres slot size for the backoff algorithm. Defaults to 100.
iex> Yggdrasil.Settings.Postgres.slot_size()
{:ok, 10}
Calling Yggdrasil.Settings.Postgres.slot_size() will ensure the following:
- Binding order: [:system, :config]
- OS environment variable: "YGGDRASIL_POSTGRES_SLOT_SIZE"
- Type: :integer
- Default: 10
- Required: false
- Cached: true
slot_size!(namespace \\ nil)
View Sourceslot_size!(Skogsra.Env.namespace()) :: integer() | no_return()
Postgres slot size for the backoff algorithm. Defaults to 100.
iex> Yggdrasil.Settings.Postgres.slot_size()
{:ok, 10}
Bang version of Yggdrasil.Settings.Postgres.slot_size/0 (fails on error). Optionally,
receives the namespace for the variable.
subscriber_connections(namespace \\ nil)
View Sourcesubscriber_connections(Skogsra.Env.namespace()) :: {:ok, integer()} | {:error, binary()}
PostgreSQL amount of subscriber connections.
iex> Yggdrasil.Settings.Postgres.subscriber_connections()
{:ok, 1}
Calling Yggdrasil.Settings.Postgres.subscriber_connections() will ensure the following:
- Binding order: [:system, :config]
- OS environment variable: "YGGDRASIL_POSTGRES_SUBSCRIBER_CONNECTIONS"
- Type: :integer
- Default: 1
- Required: false
- Cached: true
subscriber_connections!(namespace \\ nil)
View Sourcesubscriber_connections!(Skogsra.Env.namespace()) :: integer() | no_return()
PostgreSQL amount of subscriber connections.
iex> Yggdrasil.Settings.Postgres.subscriber_connections()
{:ok, 1}
Bang version of Yggdrasil.Settings.Postgres.subscriber_connections/0 (fails on error). Optionally,
receives the namespace for the variable.
template(filename, options \\ [])
View Sourcetemplate(Path.t(), keyword()) :: :ok | {:error, File.posix()}
Creates a template for OS environment variables given a filename.
Additionally, it can receive a list of options:
type: What kind of file it will generate (:elixir,:unix,:windows).namespace: Namespace for the variables.
username(namespace \\ nil)
View Sourceusername(Skogsra.Env.namespace()) :: {:ok, binary()} | {:error, binary()}
Postgres username. Defaults to "postgres".
iex> Yggdrasil.Settings.Postgres.username()
{:ok, "postgres"}
Calling Yggdrasil.Settings.Postgres.username() will ensure the following:
- Binding order: [:system, :config]
- OS environment variable: "YGGDRASIL_POSTGRES_USERNAME"
- Type: :binary
- Default: "postgres"
- Required: false
- Cached: true
username!(namespace \\ nil)
View Sourceusername!(Skogsra.Env.namespace()) :: binary() | no_return()
Postgres username. Defaults to "postgres".
iex> Yggdrasil.Settings.Postgres.username()
{:ok, "postgres"}
Bang version of Yggdrasil.Settings.Postgres.username/0 (fails on error). Optionally,
receives the namespace for the variable.