filestore-0.4.2: Interface for versioning file stores.

PortabilityGHC 6.10 required
Stabilityalpha
MaintainerJohn MacFarlane <jgm@berkeley.edu>
Safe HaskellSafe-Infered

Data.FileStore.Types

Description

Type definitions for Data.FileStore.

Synopsis

Documentation

data TimeRange Source

Constructors

TimeRange 

Fields

timeFrom :: Maybe UTCTime

Nothing means no lower bound

timeTo :: Maybe UTCTime

Nothing means no upper bound

data MergeInfo Source

Constructors

MergeInfo 

Fields

mergeRevision :: Revision

The revision w/ which changes were merged

mergeConflicts :: Bool

True if there were merge conflicts

mergeText :: String

The merged text, w/ conflict markers

data FileStoreError Source

Constructors

RepositoryExists

Tried to initialize a repo that exists

ResourceExists

Tried to create a resource that exists

NotFound

Requested resource was not found

IllegalResourceName

The specified resource name is illegal

Unchanged

The resource was not modified, because the contents were unchanged

UnsupportedOperation 
NoMaxCount

The darcs version used does not support --max-count

UnknownError String 

data SearchQuery Source

Constructors

SearchQuery 

Fields

queryPatterns :: [String]

Patterns to match

queryWholeWords :: Bool

Match patterns only with whole words?

queryMatchAll :: Bool

Return matches only from files in which all patterns match?

queryIgnoreCase :: Bool

Make matches case-insensitive?

data UTCTime

This is the simplest representation of UTC. It consists of the day number, and a time offset from midnight. Note that if a day has a leap second added to it, it will have 86401 seconds.

data FileStore Source

A versioning filestore, which can be implemented using the file system, a database, or revision-control software.

Constructors

FileStore 

Fields

initialize :: IO ()

Initialize a new filestore.

save :: Contents a => FilePath -> Author -> Description -> a -> IO ()

Save contents in the filestore.

retrieve :: Contents a => FilePath -> Maybe RevisionId -> IO a

Retrieve the contents of the named resource.

delete :: FilePath -> Author -> Description -> IO ()

Delete a named resource, providing author and log message.

rename :: FilePath -> FilePath -> Author -> Description -> IO ()

Rename a resource, providing author and log message.

history :: [FilePath] -> TimeRange -> IO [Revision]

Get history for a list of named resources in a (possibly openended) time range. If the list is empty, history for all resources will be returned. If the TimeRange is 2 Nothings, history for all dates will be returned.

latest :: FilePath -> IO RevisionId

Return the revision ID of the latest change for a resource. Raises NotFound if the resource is not found.

revision :: RevisionId -> IO Revision

Return information about a revision, given the ID. Raises NotFound if there is no such revision.

index :: IO [FilePath]

Return a list of resources in the filestore.

directory :: FilePath -> IO [Resource]

Return a list of resources in a directory of the filestore.

idsMatch :: RevisionId -> RevisionId -> Bool

True if the revision IDs match, in the sense that the can be treated as specifying the same revision.

search :: SearchQuery -> IO [SearchMatch]

Search the filestore for patterns.