Redis server configuration builder.
Generates redis.conf content from a structured configuration.
Supports all common Redis directives with an escape hatch via :extra for anything else.
Summary
Types
A Redis module path, optionally paired with an argument vector.
Functions
Creates a new config from keyword options.
Generates redis.conf file content from the config.
Types
@type append_fsync() :: :always | :everysec | :no
@type log_level() :: :debug | :verbose | :notice | :warning
A Redis module path, optionally paired with an argument vector.
Plain strings preserve the original raw loadmodule directive behavior.
Prefer {path, args} when arguments are needed so paths and arguments are
quoted safely in the generated config.
@type save_policy() :: :disabled | :default | [{pos_integer(), pos_integer()}]
@type t() :: %RedisServerWrapper.Config{ appendfsync: append_fsync(), appendonly: boolean(), bind: String.t(), cluster_announce_bus_port: non_neg_integer() | nil, cluster_announce_hostname: String.t() | nil, cluster_announce_port: non_neg_integer() | nil, cluster_config_file: String.t() | nil, cluster_enabled: boolean(), cluster_node_timeout: non_neg_integer() | nil, daemonize: boolean(), dir: String.t() | nil, extra: [{String.t(), String.t()}], loadmodule: [module_spec()], logfile: String.t() | nil, loglevel: log_level(), masterauth: String.t() | nil, maxmemory: String.t() | nil, maxmemory_policy: String.t() | nil, password: String.t() | nil, pidfile: String.t() | nil, port: non_neg_integer(), replicaof: {String.t(), non_neg_integer()} | nil, save: save_policy(), tcp_backlog: non_neg_integer() | nil, tcp_keepalive: non_neg_integer() | nil, timeout: non_neg_integer() | nil, tls_auth_clients: String.t() | nil, tls_ca_cert_file: String.t() | nil, tls_cert_file: String.t() | nil, tls_key_file: String.t() | nil, tls_port: non_neg_integer() | nil, unixsocket: String.t() | nil, unixsocketperm: String.t() | nil }
Functions
Creates a new config from keyword options.
Config.new(port: 6400, password: "secret", appendonly: true)
Config.new(
loadmodule: [
{"/path/to/module.so", ["events", "expired,set", "maxlen", "10000"]}
]
)
Generates redis.conf file content from the config.