Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module abstracts over the details of persisting the value. Journaling is also handled here, if enabled.
Synopsis
- data PersistentValue
- data PersistenceConfig = PersistenceConfig {}
- getDataFile :: StorageBackend -> Maybe FilePath -> FilePath
- getValue :: PersistentValue -> STM Value
- apply :: Modification -> PersistentValue -> IO ()
- loadFromBackend :: StorageBackend -> PersistenceConfig -> IO (Either String PersistentValue)
- setupStorageBackend :: StorageBackend -> FilePath -> IO ()
- syncToBackend :: StorageBackend -> PersistentValue -> IO ()
Documentation
data PersistentValue Source #
data PersistenceConfig Source #
getDataFile :: StorageBackend -> Maybe FilePath -> FilePath Source #
apply :: Modification -> PersistentValue -> IO () Source #
Apply a modification, and write it to the journal if enabled.
loadFromBackend :: StorageBackend -> PersistenceConfig -> IO (Either String PersistentValue) Source #
setupStorageBackend :: StorageBackend -> FilePath -> IO () Source #
Ensure that we can access the chosen storage file, and validate that it has the right file format
syncToBackend :: StorageBackend -> PersistentValue -> IO () Source #