View Source Redix.URI (Redix v1.3.0)

This module provides functions to work with a Redis URI.

This is generally intended for library developers using Redix under the hood.

Link to this section Summary

Functions

Returns start options from a Redis URI.

Link to this section Functions

Link to this function

to_start_options(uri)

View Source (since 1.2.0)
@spec to_start_options(binary()) :: Keyword.t()

Returns start options from a Redis URI.

A Redis URI looks like this:

redis://[username:password@]host[:port][/db]

examples

Examples

iex> Redix.URI.to_start_options("redis://example.com")
[host: "example.com"]

iex> Redix.URI.to_start_options("rediss://username:password@example.com:5000/3")
[ssl: true, database: 3, password: "password", username: "username", port: 5000, host: "example.com"]