caching-vault-0.1.0.0: A vault-style cache implementation
Safe HaskellNone
LanguageHaskell2010

Data.Cache.Vault

Synopsis

Documentation

newCache :: IO Cache Source #

Create a new cache container.

data Key a Source #

Instances

Instances details
Eq (Key a) Source # 
Instance details

Defined in Data.Cache.Vault

Methods

(==) :: Key a -> Key a -> Bool #

(/=) :: Key a -> Key a -> Bool #

Show (Key a) Source # 
Instance details

Defined in Data.Cache.Vault

Methods

showsPrec :: Int -> Key a -> ShowS #

show :: Key a -> String #

showList :: [Key a] -> ShowS #

mintLabeledKey :: forall a. Typeable a => Text -> Key a Source #

Mint a key with a label for a given type. Note that keys with the same label but for different types are different.

mintUniqKey :: IO (Key a) Source #

Mint a globally unique key

insert :: Key a -> Maybe UTCTime -> a -> Cache -> IO () Source #

Insert a value into the cache with an optional expiry date.

delete :: Key a -> Cache -> IO () Source #

Delete a value from the cache.

reset :: Cache -> IO () Source #

Purge all values form the cache.

lookup :: UTCTime -> Key a -> Cache -> IO (Maybe a) Source #

Given the current time, lookup a key in the cache.