annotation

LavinMQ::Config::EnvOpt

Marks a config property as settable from an environment variable.

Positional arguments (in order):

  1. the environment variable name, e.g. "LAVINMQ_AMQP_PORT"
  2. optional Proc(String, T) that converts the raw value to the property's type. When omitted, the property's own type is used and the value is converted by the matching Config#parse_value overload.

May be applied multiple times to accept several variable names for the same property. The value is assigned directly to the instance variable, bypassing any setter.

Parsed by Config#parse_env. Env vars take precedence over IniOpt but are overridden by CliOpt.

@[EnvOpt("STATE_DIRECTORY")]
@[EnvOpt("LAVINMQ_DATADIR")]
property data_dir : String = "/var/lib/lavinmq"