tcache-AWS-0.0.1: tcache using Amazon Web Services as default persistence mechanism

Safe HaskellNone

Data.TCache.AWS

Synopsis

Documentation

amazonSDBPersist :: Text -> Bool -> PersistSource

Define a default persistence mechanism in Simple AWS. . It uses the credentials using baseConfiguration from the package aws, which read them from the environment or from a file. See baseConfiguration doc. for further information

The second parameter specify either if the domain will be cleared or not

Here is an example of default persistence for a user defined data structure:

 import Data.TCache.DefaultPersistence
 import Data.TCache.AWS

 instance  Serializable MyData where
  serialize  =  pack . show
  deserialize=  read . unpack
  setPersist =  const . Just $ amazonSDBPersist "mydomain" False

If you like to use Simple AWS for all your data structures by default:

 instance  Serializable MyData where
  serialize  =  pack . show
  deserialize=  read . unpack
  setPersist =  Nothing
 setDefaultPersist  amazonSDBPersist

amazonS3Persist :: Bucket -> PersistSource

Define a default persistence mechanism in Amazon S3. . It uses the credentials using baseConfiguration from the package aws, which read them from the environment or from a file. See baseConfiguration doc. for further information

Here is an example of default persistence for a user defined data structure:

 import Data.TCache.DefaultPersistence
 import Data.TCache.AWS

 instance  Serializable MyData where
  serialize=  pack . show
  deserialize=   read . unpack
  setPersist =  const . Just amazonSDBPersist "mydomain" False

If you like to use Amazon S3 for all your data structures by default:

 instance  Serializable MyData where
  serialize=  pack . show
  deserialize=   read . unpack
  setPersist =  Nothing
 setDefaultPersist  amazonSDBPersist