Packages

In-memory fake for Riak, etcd, Redis and memcached that speaks their wire protocols on TCP, so you can point real clients at it. Ships as an escript.

Current section

Files

Jump to
fake_riak config config.exs
Raw

config/config.exs

import Config
# Each fake KV endpoint can be switched on/off and pointed at any TCP port.
# Set `enabled: false` to disable an endpoint entirely.
# Riak KV — HTTP API, bucketed (GET/PUT/DELETE /buckets/:bucket/keys/:key)
config :fake_riak, FakeRiak.Riak, enabled: true, port: 8098
# Redis — RESP protocol, bucketless (GET/SET/DEL ...)
config :fake_riak, FakeRiak.Redis, enabled: true, port: 6379
# etcd — v2 HTTP/JSON API, bucketless (GET/PUT/DELETE /v2/keys/:key)
config :fake_riak, FakeRiak.Etcd, enabled: true, port: 2379
# memcached — text protocol, bucketless (get/set/delete ...)
config :fake_riak, FakeRiak.Memcached, enabled: true, port: 11211
# During tests the endpoints are started explicitly on OS-assigned ports, so
# don't auto-bind the well-known ports (which may be busy or privileged).
if config_env() == :test do
config :fake_riak, FakeRiak.Riak, enabled: false
config :fake_riak, FakeRiak.Redis, enabled: false
config :fake_riak, FakeRiak.Etcd, enabled: false
config :fake_riak, FakeRiak.Memcached, enabled: false
end