content-store-0.2.0: Store and retrieve data from an on-disk store

Copyright(c) 2017 Red Hat Inc.
LicenseLGPL
Maintainerhttps://github.com/weldr
Stabilityalpha
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Data.ContentStore.Config

Description

Manage the content store's internal config file.

Synopsis

Documentation

data Config Source #

Configuration information needed by the content store.

Constructors

Config 

Fields

  • confCompressed :: Bool

    Is the data in the content store compressed? If this option is missing in a config file, we assume that the data is not compressed. This is to keep backwards compatibility with previous versions of the content store that did not support compression. New content stores are created supporting compressed contents by default.

  • confHash :: Text

    What DigestAlgorithm is in use by this content store? While we do support several different algorithms, only one can ever be in use by a single content store. Note that the ContentStore record also stores this piece of information. The difference is that here, we are only storing the text representation as given in a config file.

defaultConfig :: Config Source #

Construct a default Config record useful for when creating a new ContentStore, as with mkContentStore. Among other things, this is where the default hash algorithm is defined.

readConfig :: FilePath -> IO (Either Text Config) Source #

Read a config file on disk, returning the Config record on success and an error message on error. This function is typically not useful outside of content store internals.

writeConfig :: FilePath -> Config -> IO () Source #

Write a Config object to disk. This function is typically not useful outside of content store internals.