Microservice wrapping HTTP REST around memcached protocol.
Standard rust cargo multi-binary setup:
$ cargo build
$ cargo run --bin memproxy
$ mkdir -p /tmp/conf && cp cfg-memproxy.json /tmp/conf
$ docker run --rm -p 8080:8080 -v /tmp/conf:/conf memproxy memproxy --bind-addr 0.0.0.0 --config /conf/cfg-memproxy.json
$ curl http://127.0.0.1:8080/ | json_pp
A JSON configuration file is required, to specify memcached configuration. Command line options are also available.
See example-cfg-memproxy.json
for an example configuration file.
Also, limited options are available at the command line. Run --help
to view available options:
$ cargo run --bin memproxy -- --help
Connect to HTTP endpoint using any web client.
GET /
GET /stats
GET /cache/$KEY
PUT /cache/$KEY
DELETE /cache/$KEY
Integration testing is performed via a separate binary, tester
.
$ cargo run --bin tester
- If the TCP connection to memcached is broken (eg. memcached restarts), the rust memcache library does not recover (does not start a new TCP connection).
- If memcached is not reachable, program will not start.