Bandera.Store.Persistent.Redis (bandera v0.1.0)

Copy Markdown

Redis persistence adapter (via Redix).

Each flag is a Redis hash (bandera:flag:<name>) keyed by gate id; all flag names live in a set (bandera:flag_names). The connection options are read at start time from config :bandera, persistence: [redis: <keyword of Redix opts>] — nothing is fixed at compile time.

Add the connection to your supervision tree (or let Bandera.Application start it when the Redis adapter is configured):

config :bandera,
  persistence: [adapter: Bandera.Store.Persistent.Redis, redis: [host: "localhost", port: 6379]]

Errors

Connection/command failures return {:error, reason} (a Redix.Error or Redix.ConnectionError).

Summary

Functions

Child spec so the connection can be added to a supervision tree.

Start the named Redix connection. Options merge over config :bandera, persistence: [redis: ...].

Functions

child_spec(opts)

@spec child_spec(keyword()) :: Supervisor.child_spec()

Child spec so the connection can be added to a supervision tree.

start_link(opts \\ [])

@spec start_link(keyword()) :: GenServer.on_start()

Start the named Redix connection. Options merge over config :bandera, persistence: [redis: ...].