Expander v0.0.1 Expander.Cache.Adapter.Redix View Source

An adapter that uses Redis as a caching engine.

Example

# config/config.exs
config :sample, Sample.Expander,
  adapter: Expander.Cache.Adapter.Redix,
  conn: [host: "localhost", port: 6379]

# lib/sample/expander.ex
defmodule Sample.Expander do
  use Expander.Expand, otp_app: :expander, adapter: Expander.Cache.Adapter.Redix
end

Link to this section Summary

Functions

Get URL from cache

Set URL in cache

Connects to redis to store data using provided config

Link to this section Functions

Get URL from cache.

Callback implementation for Expander.Cache.Adapter.get/2.

Connects to redis to store data using provided config.

Config

  • conn: The Redis to connect to, as either a string or list of opts w/ host, port, password, and database.

    • Default: "redis://localhost:6379"
  • initial: A map of key/value pairs to ensure are set in redis at boot.

    • Default: %{}

All other options are passed verbatim to Redix.start_link/2.