Redis server configuration builder.
Generates redis.conf content from a structured configuration.
Supports common Redis directives plus token-safe :extra directives for
anything else. Every value is encoded as a Redis configuration token.
Summary
Types
A Redis module path, optionally paired with an argument vector.
Functions
Builds the client connection used to control this Redis server.
Returns the address used by redis-cli and lifecycle probes.
Encodes one Redis configuration directive from an argument vector.
Returns normalized Redis listen-address tokens.
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.
A plain string is one module-path token. Use {path, args} when arguments
are needed; paths and arguments are always quoted safely when required.
@type save_policy() :: :disabled | :default | [{pos_integer(), pos_integer()}]
@type t() :: %RedisServerWrapper.Config{ appendfsync: append_fsync(), appendonly: boolean(), bind: bind_addresses(), 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, control_host: String.t() | nil, daemonize: boolean(), dir: String.t() | nil, extra: [extra_spec()], loadmodule: [module_spec()], logfile: String.t() | nil, loglevel: log_level(), masterauth: String.t() | nil, masteruser: 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_dir: String.t() | nil, tls_ca_cert_file: String.t() | nil, tls_cert_file: String.t() | nil, tls_client_cert_file: String.t() | nil, tls_client_key_file: String.t() | nil, tls_cluster: boolean(), tls_insecure: boolean(), tls_key_file: String.t() | nil, tls_port: non_neg_integer() | nil, tls_replication: boolean(), tls_server_name: String.t() | nil, unixsocket: String.t() | nil, unixsocketperm: String.t() | nil, username: String.t() | nil }
Functions
@spec connection(t()) :: RedisServerWrapper.Connection.t()
Builds the client connection used to control this Redis server.
Returns the address used by redis-cli and lifecycle probes.
:bind controls Redis listen addresses. Set :control_host when Redis
listens on multiple addresses or on a wildcard address.
Encodes one Redis configuration directive from an argument vector.
This is also used by the Sentinel configuration generator so it follows the
same quoting and escaping rules as redis.conf.
Returns normalized Redis listen-address tokens.
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.