Copyright | (c) David Terei 2016 |
---|---|
License | BSD |
Maintainer | code@davidterei.com |
Stability | stable |
Portability | GHC |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Stores the various types needed by Memcached. Mostly concerned with the representation of the protocol.
Synopsis
- data Authentication
- type Username = ByteString
- type Password = ByteString
- data Q
- data K
- = NoKey
- | IncludeKey
- type Key = ByteString
- type Value = ByteString
- type Extras = ByteString
- type Initial = Word64
- type Delta = Word64
- type Expiration = Word32
- type Flags = Word32
- type Version = Word64
- data Status
- data Header = Header {}
- mEMCACHE_HEADER_SIZE :: Int
- data PktType
- data Request = Req {}
- data OpRequest
- = ReqGet Q K Key
- | ReqSet Q Key Value SESet
- | ReqAdd Q Key Value SESet
- | ReqReplace Q Key Value SESet
- | ReqDelete Q Key
- | ReqIncrement Q Key SEIncr
- | ReqDecrement Q Key SEIncr
- | ReqAppend Q Key Value
- | ReqPrepend Q Key Value
- | ReqTouch Key SETouch
- | ReqGAT Q K Key SETouch
- | ReqFlush Q (Maybe SETouch)
- | ReqNoop
- | ReqVersion
- | ReqStat (Maybe Key)
- | ReqQuit Q
- | ReqSASLList
- | ReqSASLStart Key Value
- | ReqSASLStep Key Value
- | ReqRaw Word8 (Maybe Key) (Maybe Value) SERaw
- data SESet = SESet Flags Expiration
- data SEIncr = SEIncr Initial Delta Expiration
- data SETouch = SETouch Expiration
- data SERaw = SERaw Builder Int
- emptyReq :: Request
- data Response = Res {}
- data OpResponse
- = ResGet Q Value Flags
- | ResGetK Q Key Value Flags
- | ResSet Q
- | ResAdd Q
- | ResReplace Q
- | ResDelete Q
- | ResIncrement Q Word64
- | ResDecrement Q Word64
- | ResAppend Q
- | ResPrepend Q
- | ResTouch
- | ResGAT Q Value Flags
- | ResGATK Q Key Value Flags
- | ResFlush Q
- | ResNoop
- | ResVersion Value
- | ResStat Key Value
- | ResQuit Q
- | ResSASLList Value
- | ResSASLStart
- | ResSASLStep
- emptyRes :: Response
SASL Authentication
data Authentication Source #
SASL Authentication information for a server.
Instances
Show Authentication Source # | |
Defined in Database.Memcache.Types showsPrec :: Int -> Authentication -> ShowS # show :: Authentication -> String # showList :: [Authentication] -> ShowS # | |
Eq Authentication Source # | |
Defined in Database.Memcache.Types (==) :: Authentication -> Authentication -> Bool # (/=) :: Authentication -> Authentication -> Bool # |
type Username = ByteString Source #
Username for authentication.
type Password = ByteString Source #
Password for authentication.
Fields & Values
type Key = ByteString Source #
type Value = ByteString Source #
type Extras = ByteString Source #
type Expiration = Word32 Source #
The status (success or error) of a Memcached operation returned in a
Response
.
NoError | Operation successful. |
ErrKeyNotFound | Key not found. |
ErrKeyExists | Key exists when not expected. |
ErrValueTooLarge | Value too large to store at server. |
ErrInvalidArgs | Invalid arguments for operation. |
ErrItemNotStored | Key-Value pair not stored at server (internal error). |
ErrValueNonNumeric | Value not numeric when increment or decrement requested. |
ErrUnknownCommand | Server doesn't know requested command. |
ErrOutOfMemory | Server out of memory. |
SaslAuthFail | SASL authentication failed. |
SaslAuthContinue | SASL authentication requires more steps. |
Header
Requests
ReqGet Q K Key | |
ReqSet Q Key Value SESet | |
ReqAdd Q Key Value SESet | |
ReqReplace Q Key Value SESet | |
ReqDelete Q Key | |
ReqIncrement Q Key SEIncr | |
ReqDecrement Q Key SEIncr | |
ReqAppend Q Key Value | |
ReqPrepend Q Key Value | |
ReqTouch Key SETouch | |
ReqGAT Q K Key SETouch | |
ReqFlush Q (Maybe SETouch) | |
ReqNoop | |
ReqVersion | |
ReqStat (Maybe Key) | |
ReqQuit Q | |
ReqSASLList | |
ReqSASLStart Key Value | |
ReqSASLStep Key Value | |
ReqRaw Word8 (Maybe Key) (Maybe Value) SERaw | Warning: This is dangerous; no future compatability guaranteed Raw request is custom requests, dangerous as no corresponding raw response... |
Responses
Memcached response packet.
Instances
data OpResponse Source #
Instances
Show OpResponse Source # | |
Defined in Database.Memcache.Types showsPrec :: Int -> OpResponse -> ShowS # show :: OpResponse -> String # showList :: [OpResponse] -> ShowS # | |
Eq OpResponse Source # | |
Defined in Database.Memcache.Types (==) :: OpResponse -> OpResponse -> Bool # (/=) :: OpResponse -> OpResponse -> Bool # |