Skip to content
forked from jebu/erlmc

Erlang memcached binary protocol client

Notifications You must be signed in to change notification settings

bipthelin/erlmc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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()}]

About

Erlang memcached binary protocol client

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Erlang 100.0%