ron-storage-0.7: RON Storage

Safe HaskellNone
LanguageHaskell2010

RON.Storage

Description

RON Storage interface. For usage, see RON.Storage.FS.

Synopsis

Documentation

class (ReplicatedAsObject a, Typeable a) => Collection a where Source #

A type that intended to be put in a separate collection must define a Collection instance.

Minimal complete definition

collectionName

Methods

collectionName :: CollectionName Source #

fallbackParse :: MonadE m => UUID -> ByteStringL -> m (Object a) Source #

Called when RON parser fails.

type CollectionName = FilePath Source #

Collection (directory name)

data DocId a Source #

Document identifier (directory name), should be a RON-Base32-encoded RON-UUID.

Instances
Eq (DocId a) Source # 
Instance details

Defined in RON.Storage.Backend

Methods

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

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

Ord (DocId a) Source # 
Instance details

Defined in RON.Storage.Backend

Methods

compare :: DocId a -> DocId a -> Ordering #

(<) :: DocId a -> DocId a -> Bool #

(<=) :: DocId a -> DocId a -> Bool #

(>) :: DocId a -> DocId a -> Bool #

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

max :: DocId a -> DocId a -> DocId a #

min :: DocId a -> DocId a -> DocId a #

Collection a => Show (DocId a) Source # 
Instance details

Defined in RON.Storage.Backend

Methods

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

show :: DocId a -> String #

showList :: [DocId a] -> ShowS #

createDocument :: (Collection a, MonadStorage m) => Object a -> m () Source #

Create document assuming it doesn't exist yet.

decodeDocId Source #

Arguments

:: DocId a 
-> Maybe (Bool, UUID)

Bool = is document id a valid UUID encoding

Try decode UUID from a file name

loadDocument :: (Collection a, MonadStorage m) => DocId a -> m (Document a) Source #

Load all versions of a document

modify :: (Collection a, MonadStorage m) => DocId a -> StateT (Object a) m () -> m (Object a) Source #

Load document, apply changes and put it back to storage