ClusterHelper.Config (ClusterHelper v1.0.1)

Copy Markdown View Source

Configuration struct for ClusterHelper.

Use ClusterHelper.Config.from_app_env/0 to load configuration from application environment, or construct one directly for testing.

Summary

Functions

Builds a Config from application environment (Application.get_env/2).

Resolves nil scope to the configured default scope.

Types

t()

@type t() :: %ClusterHelper.Config{
  event_handler: module() | nil,
  pull_interval: pos_integer(),
  pull_timeout: pos_integer(),
  roles: [term()],
  scope: atom(),
  scopes: [atom()] | nil
}

Functions

from_app_env()

@spec from_app_env() :: t()

Builds a Config from application environment (Application.get_env/2).

All fields have sensible defaults, so this never fails.

resolve_scope(config, scope)

@spec resolve_scope(t(), atom() | nil) :: atom()

Resolves nil scope to the configured default scope.