Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Erlang memcached binary protocol client

branch: master

Merge pull request #2 from Elzor/app

Added APP file
latest commit 1bf6085d4a
Jacob Vorreuter authored February 07, 2012
Octocat-spinner-32 ebin renaming mcerlang to erlmc October 20, 2009
Octocat-spinner-32 include renaming mcerlang to erlmc October 20, 2009
Octocat-spinner-32 src Added APP file February 08, 2012
Octocat-spinner-32 t fixed test script December 16, 2009
Octocat-spinner-32 .gitignore switching to .app.in file June 04, 2009
Octocat-spinner-32 Emakefile updating build process February 25, 2010
Octocat-spinner-32 Makefile updating build process February 25, 2010
Octocat-spinner-32 README.markdown renaming mcerlang to erlmc October 20, 2009
README.markdown

erlmc

Erlang binary protocol memcached client

External Documentation

Binary Protocol Spec http://code.google.com/p/memcached/wiki/MemcacheBinaryProtocol

Quick Start

You must have version 1.3 or greater of memcached

$> make
$> make test
$> sudo make install
$> memcached -d

1> erlmc:start().
ok

2> erlmc:stats().
[{{"localhost",11211},
  [{evictions,"0"},
   {total_items,"0"},
   {curr_items,"0"},
   {bytes,"0"},
   {...}|...]}]

3> erlmc:set(hello, <<"World">>).
<<>>

4> erlmc:get(hello).
<<"World">>

5> erlmc:add("foo", <<"bar">>).
<<>>

6> erlmc:get("foo").
<<"bar">>

Commands

  • get(Key::any()) -> Val::binary()
  • get_many([Key::any()]) -> [Val::binary()]
  • add(Key::any(), Val::binary()) -> Response::binary()
  • add(Key::any(), Val::binary(), Expiration::integer()) -> Response::binary()
  • set(Key::any(), Val::binary()) -> Response::binary()
  • set(Key::any(), Val::binary(), Expiration::integer()) -> Response::binary()
  • replace(Key::any(), Val::binary()) -> Response::binary()
  • replace(Key::any(), Val::binary(), Expiration::integer()) -> Response::binary()
  • delete(Key::any()) -> Response::binary()
  • increment(Key::any(), Val::binary(), Initial::binary(), Expiration::integer()) -> Response::binary()
  • decrement(Key::any(), Val::binary(), Initial::binary(), Expiration::integer()) -> Response::binary()
  • append(Key::any(), Val::binary()) -> Response::binary()
  • prepend(Key::any(), Val::binary()) -> Response::binary()
  • stat() -> [{{Host::string(), Port::integer()}, Response::binary()}]
  • flush() -> [{{Host::string(), Port::integer()}, Response::binary()}]
  • flush(Expiration::integer()) -> [{{Host::string(), Port::integer()}, Response::binary()}]
  • quit() -> [{{Host::string(), Port::integer()}, Response::binary()}]
  • version() -> [{{Host::string(), Port::integer()}, Response::binary()}]
Something went wrong with that request. Please try again.