couch-simple-0.0.1.0: A modern, lightweight, complete client for CouchDB

CopyrightCopyright (c) 2015, Michael Alan Dorman
LicenseMIT
Maintainermdorman@jaunder.io
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Database.Couch.Explicit.Configuration

Contents

Description

This module is intended to be import qualified. No attempt has been made to keep names of types or functions from clashing with obvious or otherwise commonly-used names, or even other modules within this package.

The functions here are derived from (and presented in the same order as) the Server Configuration API documentation. For each function, we attempt to link back to the original documentation, as well as make a notation as to how complete and correct we feel our implementation is.

Each function takes a Context as its final parameter, and returns a Result.

Synopsis

Documentation

server :: (FromJSON a, MonadIO m) => Context -> m (Result a) Source

Get the overall server configuration

The return value is an object whose fields often vary, so it is most easily decoded as a Value:

>>> value :: Result Value <- Configuration.server ctx

Status: Complete

section Source

Arguments

:: (FromJSON a, MonadIO m) 
=> DocId

Section name

-> Context 
-> m (Result a) 

Get the configuration for one section

The return value is an object whose fields often vary, so it is most easily decoded as a Value:

>>> value :: Result Value <- Configuration.section "auth" ctx

Status: Complete

getValue Source

Arguments

:: (FromJSON a, MonadIO m) 
=> DocId

Section name

-> DocId

Key name

-> Context 
-> m (Result a) 

Get the configuration for one item

The return value is a JSON Value whose fields often vary, so it is most easily decoded as a Value:

>>> value :: Result Value <- Configuration.getValue "auth" "ssl" ctx

Status: Complete

setValue Source

Arguments

:: (ToJSON a, FromJSON b, MonadIO m) 
=> DocId

Section name

-> DocId

Key name

-> a

Value

-> Context 
-> m (Result b) 

Set the configuration value for one item

The value to set must be something that can be translated to JSON.

The return value is a JSON Value whose fields often vary, so it is most easily decoded as a Value:

>>> value :: Result Value <- Configuration.setValue "auth" "ssl" Bool ctx

Status: Complete

delValue Source

Arguments

:: (FromJSON a, MonadIO m) 
=> DocId

Section name

-> DocId

Key name

-> Context 
-> m (Result a) 

Remove the configuration value for one item

Returns the previous JSON Value.

The return value is a JSON Value whose fields often vary, so it is most easily decoded as a Value:

>>> value :: Result Value <- Configuration.delValue "auth" "ssl" ctx

Status: Complete

Internal combinators

configPath :: RequestBuilder () Source

Base path for all config requests

sectionPath Source

Arguments

:: DocId

Section name

-> RequestBuilder () 

Base path for all section requests

itemPath Source

Arguments

:: DocId

Section name

-> DocId

Key name

-> RequestBuilder () 

Base path for all item requests