-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell implementation of the Tokyo Tyrant binary protocol -- -- A pure Haskell implementation of the Tokyo Tyrant binary protocol. -- Tokyo Tyrant is a database server for the Tokyo Cabinet database -- library. http:tokyocabinet.sourceforge.nettyrantdoc @package haskell-tyrant @version 0.4 -- | A pure Haskell interface to the Tokyo Tyrant database server module Database.TokyoTyrant data TyrantOption RecordLocking :: TyrantOption GlobalLocking :: TyrantOption NoUpdateLog :: TyrantOption data TokyoTyrantHandle -- | Connect to Tokyo Tyrant openConnection :: HostName -> ServiceName -> IO TokyoTyrantHandle -- | Close connection to ttserver closeConnection :: TokyoTyrantHandle -> IO () -- | Store a record putValue :: TokyoTyrantHandle -> ByteString -> ByteString -> IO (Either String String) -- | Retrieve a record getValue :: TokyoTyrantHandle -> ByteString -> IO (Either String ByteString) getDouble :: TokyoTyrantHandle -> ByteString -> IO (Either [Char] Double) -- | Store a record where the value is a double putDouble :: TokyoTyrantHandle -> ByteString -> Double -> IO (Either [Char] Double) -- | Retrieve a record with an Int value getInt :: TokyoTyrantHandle -> ByteString -> IO (Either [Char] Int) -- | Store a record with an Int value putInt :: TokyoTyrantHandle -> ByteString -> Int -> IO (Either [Char] Int) -- | Store a new record If key already exists nothing is done putKeep :: TokyoTyrantHandle -> ByteString -> ByteString -> IO (Either String String) -- | Concatenate a value at the end of the existing record putCat :: TokyoTyrantHandle -> ByteString -> ByteString -> IO (Either String String) -- | Remove a record out :: TokyoTyrantHandle -> ByteString -> IO (Either String String) -- | Get the size of the value of a record vsiz :: TokyoTyrantHandle -> ByteString -> IO (Either [Char] Int) -- | Fetch keys and values for multiple records mget :: TokyoTyrantHandle -> [ByteString] -> IO (Either [Char] [(ByteString, ByteString)]) -- | Remove all records vanish :: TokyoTyrantHandle -> IO (Either String String) -- | Synchronize updated contents with the database file sync :: TokyoTyrantHandle -> IO (Either String String) -- | Copy the database file to the specified path copy :: TokyoTyrantHandle -> ByteString -> IO (Either String String) -- | Add an integer to a record addInt :: Integral a => TokyoTyrantHandle -> ByteString -> a -> IO (Either [Char] Int) -- | Get the size of the database size :: TokyoTyrantHandle -> IO (Either [Char] Int) -- | Get the number of records rnum :: TokyoTyrantHandle -> IO (Either [Char] Int) -- | Get the stats string stat :: TokyoTyrantHandle -> IO (Either [Char] [[ByteString]]) -- | Restore the database with update log restore :: Integral a => TokyoTyrantHandle -> ByteString -> a -> IO (Either String String) setmst :: Integral a => TokyoTyrantHandle -> ByteString -> a -> IO (Either String String) addDouble :: RealFrac b => TokyoTyrantHandle -> ByteString -> b -> IO (Either String Double) -- | concatenate a value at the end of the existing record and shift it to -- the lef putshl :: Integral a => TokyoTyrantHandle -> ByteString -> ByteString -> a -> IO (Either String String) -- | store a record into a remote database object without response from the -- server putnr :: TokyoTyrantHandle -> ByteString -> ByteString -> IO () -- | initialize the iterator of a remote database object iterinit :: TokyoTyrantHandle -> IO (Either String String) -- | get the next key of the iterator of a remote database object iternext :: TokyoTyrantHandle -> IO (Either [Char] ByteString) -- | get forward matching keys in a remote database object fwmkeys :: Integral a => TokyoTyrantHandle -> ByteString -> a -> IO (Either [Char] [ByteString]) -- | Call a function of the script language extension ext :: TokyoTyrantHandle -> ByteString -> ByteString -> ByteString -> [TyrantOption] -> IO (Either [Char] ByteString) -- | Call a versatile function for miscellaneous operations funcname can be -- getlist, putlist and outlist getlist takes a list -- of keys and returns a list of values putlist takes a list of keys and -- values one after the other and returns [] outlist takes a list of keys -- and removes those records misc :: TokyoTyrantHandle -> ByteString -> [ByteString] -> [TyrantOption] -> IO (Either [Char] [ByteString]) instance Eq TyrantOption instance Show TyrantOption