Syntropy.ClusterConfig (syntropy v0.1.0)

Copy Markdown

Hosted cluster configuration boundary for Syntropy.

This module normalizes cluster-related runtime configuration so hosted static peer clustering and local gossip clustering can share the same public shape.

Summary

Types

mode()

@type mode() :: :disabled | :gossip | :static

t()

@type t() :: %{
  enabled: boolean(),
  mode: mode(),
  node_id: String.t() | nil,
  expected_peers: [String.t()],
  dist_port: pos_integer(),
  demo_seed_profile: String.t() | nil
}

Functions

current()

@spec current() :: t()

demo_seed_profile()

@spec demo_seed_profile() :: String.t() | nil

enabled?()

@spec enabled?() :: boolean()

expected_peers()

@spec expected_peers() :: [String.t()]

from_env(env, runtime_env)

@spec from_env(map() | [{String.t(), String.t()}], atom()) :: t()

topologies(map)

@spec topologies(t()) :: keyword()

validate_runtime!(cluster_config, opts \\ [])

@spec validate_runtime!(
  t(),
  keyword()
) :: :ok