memcache-0.1.0.0: A memcached client library.

Safe HaskellNone
LanguageHaskell2010

Database.Memcache.Client

Contents

Description

A memcache client. Supports the binary protocol (only) and SASL authentication.

A client can connect to a single memcache server or a cluster of them. In the later case, consistent hashing is used to route requests to the appropriate server.

Expected return values (like misses) are returned as part of the return type, while unexpected errors are thrown as exceptions.

Synopsis

Cluster and connection handling

data ServerSpec Source

ServerSpec specifies a server configuration to connect to.

defaultServerSpec :: ServerSpec Source

Provides a default value for a server cconnection config.

data Options Source

Options specifies how a memcache cluster should be configured.

Constructors

Options 

Fields

optsCmdFailure :: !FailureMode
 
optsServerFailure :: !FailureMode
 
optsServerRetries :: !Int
 

defaultOptions :: Options Source

Provides recommended default for a cluster Options.

data Authentication Source

SASL Authentication information for a server.

Constructors

Auth 
NoAuth 

type Username = ByteString Source

Username for authentication.

type Password = ByteString Source

Password for authentication.

Get operations

Set operations

Delete operations

Modify operations

Information operations

version :: Cluster -> IO ByteString Source

Version returns the version string of the memcached cluster. We just query one server and assume all servers in the cluster are the same version.

type StatResults = [(ByteString, ByteString)] Source

StatResults are a list of key-value pairs.

Error handling

data MemcacheError Source

Exceptions that may be thrown by Memcache. These are expected error codes returned by a memcached server.

data ClientError Source

Errors that occur between the client and server in communicating. These are unexpected exceptions, such as network failures or garbage data.

Constructors

NotEnoughBytes