LemonGateway.Config (lemon_gateway v0.1.0)

View Source

Centralized configuration for LemonGateway.

Loads configuration from the canonical Lemon TOML config (via ConfigLoader).

Summary

Functions

Returns a specification to start this module under a supervisor.

Returns the full configuration map.

Returns the value for a specific configuration key.

Returns all configured bindings as a list of Binding structs.

Returns all configured projects as a map of project_id => Project struct.

Returns the queue configuration (cap, drop policy).

A full-replacement config map held in app env, if one is set.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get()

@spec get() :: map()

Returns the full configuration map.

get(key)

@spec get(atom()) :: term()

Returns the value for a specific configuration key.

get_bindings()

@spec get_bindings() :: [LemonCore.Binding.t()]

Returns all configured bindings as a list of Binding structs.

get_projects()

@spec get_projects() :: %{required(String.t()) => LemonGateway.Project.t()}

Returns all configured projects as a map of project_id => Project struct.

get_queue_config()

@spec get_queue_config() :: %{
  cap: non_neg_integer() | nil,
  drop: :oldest | :newest | nil,
  mode: atom() | nil
}

Returns the queue configuration (cap, drop policy).

replacement_config()

@spec replacement_config() :: map() | keyword() | nil

A full-replacement config map held in app env, if one is set.

Embedders and tests can put a complete config under config :lemon_gateway, LemonGateway.Config, %{...} to bypass the canonical loader. Exposed for LemonCore.EngineInfoBridge, so callers outside this app read it through the bridge instead of reaching into our app env.

start_link(opts)